Development Team/Almanac/sugar.profile: Difference between revisions

No edit summary
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>