Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWade Brainerd <wadetb@gmail.com>2009-11-29 23:54:18 (GMT)
committer Wade Brainerd <wadetb@gmail.com>2009-11-29 23:54:18 (GMT)
commita300223538645271525d049c076d95e586e67c10 (patch)
treedb4b1723b8ca0a5708e47a5b515022850e2cd2cd
parent20d50b70960983459d5f42290f0f665dc6f0a32f (diff)
Support failure to import GConf (disables server authentication)
-rw-r--r--webactivity.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/webactivity.py b/webactivity.py
index decdbbd..5adcf9c 100644
--- a/webactivity.py
+++ b/webactivity.py
@@ -29,9 +29,14 @@ import time
import shutil
import sqlite3
import cjson
-import gconf
import locale
+# If GConf is not available, automatic server authentication is disabled.
+try:
+ import gconf
+except ImportError:
+ pass
+
# HACK: Needed by http://dev.sugarlabs.org/ticket/456
try:
import gnome
@@ -83,7 +88,14 @@ if _profile_version < PROFILE_VERSION:
def _seed_xs_cookie():
''' Create a HTTP Cookie to authenticate with the Schoolserver
'''
- client = gconf.client_get_default()
+ # If GConf is not available, automatic authentication is disabled.
+ # We could fix this by adding an alternate configuration mechanism for older
+ # versions of Sugar.
+ try:
+ client = gconf.client_get_default()
+ except NameError:
+ return
+
backup_url = client.get_string('/desktop/sugar/backup_url')
if not backup_url:
_logger.debug('seed_xs_cookie: Not registered with Schoolserver')