Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Development Team/Almanac/sugar.profile
(view source)
Revision as of 15:02, 7 January 2010
468 bytes added
,
15:02, 7 January 2010
→How do I get the school server with which this child is associated?
Line 73:
Line 73:
=== How do I get the school server with which this child is associated? ===
=== How do I get the school server with which this child is associated? ===
+
Method on the 82: DEPRECATED
<pre>
<pre>
from sugar import profile
from sugar import profile
Line 83:
Line 84:
#Print out whether this XO is actually registered with a school server
#Print out whether this XO is actually registered with a school server
print prof.jabber_registered
print prof.jabber_registered
+
</pre>
+
+
Get school server with both older and new implementations.
+
<pre>
+
from sugar import profile
+
...
+
prof = profile.get_profile()
+
+
jabber_serv = None
+
if hasattr(profile, 'jabber_server'):
+
jabber_serv = profile.jabber_server
+
else:
+
import gconf
+
client = gconf.client_get_default()
+
jabber_serv = client.get_string("/desktop/sugar/collaboration/jabber_server")
</pre>
</pre>
Walter
Bureaucrats
,
Administrators
10,579
edits