from xml.dom.minidom import parse, parseString
from forum.base import get_database_engine
from xml.dom.minidom import parse, parseString
from forum.base import get_database_engine
from forum.settings import APP_URL, SVN_REVISION, APP_TITLE, APP_DESCRIPTION
from django import VERSION as DJANGO_VERSION
from django.utils import simplejson
from forum.settings import APP_URL, SVN_REVISION, APP_TITLE, APP_DESCRIPTION
from django import VERSION as DJANGO_VERSION
from django.utils import simplejson
<key value="%(site_key)s" />
<app_url value="%(app_url)s" />
<app_title value="%(app_title)s" />
<app_description value="%(app_description)s" />
<svn_revision value="%(svn_revision)d" />
<views value="%(site_views)d" />
<key value="%(site_key)s" />
<app_url value="%(app_url)s" />
<app_title value="%(app_title)s" />
<app_description value="%(app_description)s" />
<svn_revision value="%(svn_revision)d" />
<views value="%(site_views)d" />
<active_users value="%(active_users)d" />
<server value="%(server_name)s" />
<python_version value="%(python_version)s" />
<active_users value="%(active_users)d" />
<server value="%(server_name)s" />
<python_version value="%(python_version)s" />
'svn_revision' : svn_revision,
'site_views' : get_site_views(),
'server_name' : get_server_name(),
'svn_revision' : svn_revision,
'site_views' : get_site_views(),
'server_name' : get_server_name(),
+ 'questions_count' : Question.objects.filter_state(deleted=False).count(),
+ 'answers_count' : Answer.objects.filter_state(deleted=False).count(),
+ 'comments_count' : Comment.objects.filter_state(deleted=False).count(),
'active_users' : get_active_users(),
'python_version' : ''.join(sys.version.splitlines()),
'django_version' : str(DJANGO_VERSION),
'database' : database_type,
'active_users' : get_active_users(),
'python_version' : ''.join(sys.version.splitlines()),
'django_version' : str(DJANGO_VERSION),
'database' : database_type,
'emails' : admin_emails_xml,
}
# Compress the statistics XML dump
'emails' : admin_emails_xml,
}
# Compress the statistics XML dump
statistics_compressed = bz2.compress(statistics)
# Pass the compressed statistics to the update server
statistics_compressed = bz2.compress(statistics)
# Pass the compressed statistics to the update server
# Trigger the update process
now = datetime.datetime.now()
if (now - settings.LATEST_UPDATE_DATETIME) > datetime.timedelta(days=1):
# Trigger the update process
now = datetime.datetime.now()
if (now - settings.LATEST_UPDATE_DATETIME) > datetime.timedelta(days=1):
- update_status = check_for_updates()
-
- logging.error(smart_unicode("Update process has been triggered: %s" % update_status))
- settings.LATEST_UPDATE_DATETIME.set_value(now)
+ try:
+ update_status = check_for_updates()
+ logging.log(logging.INFO, smart_unicode("Update process has been triggered: %s" % update_status))
+ except Exception, e:
+ logging.errror(smart_unicode(e))
+ finally:
+ settings.LATEST_UPDATE_DATETIME.set_value(now)