[Sugar-devel] [PATCH v2] Removed hardcoded server url (SL #1976)

Dipankar Patro dipankar at seeta.in
Fri Oct 15 10:37:55 EDT 2010


Previously registration url was set hardcoded for XO device.
Modififed the code for same behavior on all devices. Register
url is taken from gconf prop. If the gconf is empty or unset,
registration url falls back to 'schoolserver'.
---
 src/jarabe/desktop/schoolserver.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

v1 was reviewed by James Cameron <quozl at laptop.org>
v2 : wrapped the commit message.

diff --git a/src/jarabe/desktop/schoolserver.py b/src/jarabe/desktop/schoolserver.py
index a05f56c..57b7ddf 100644
--- a/src/jarabe/desktop/schoolserver.py
+++ b/src/jarabe/desktop/schoolserver.py
@@ -89,9 +89,12 @@ def register_laptop(url=REGISTER_URL):
     else:
         sn = generate_serial_number()
         uuid_ = str(uuid.uuid1())
-        setting_name = '/desktop/sugar/collaboration/jabber_server'
-        jabber_server = client.get_string(setting_name)
-        store_identifiers(sn, uuid_, jabber_server)
+        
+    setting_name = '/desktop/sugar/collaboration/jabber_server'
+    jabber_server = client.get_string(setting_name)
+    store_identifiers(sn, uuid_, jabber_server)
+    
+    if jabber_server:
         url = 'http://' + jabber_server + ':8080/'
 
     nick = client.get_string('/desktop/sugar/user/nick')
-- 
1.7.0.4



More information about the Sugar-devel mailing list