[Sugar-devel] [PATCH] Remove hard-coded School Server URL when XOs register #sl1976

Sascha Silbe sascha-ml-ui-sugar-devel at silbe.org
Sun Jul 4 05:42:08 EDT 2010


Excerpts from Tim McNamara's message of Sat Jul 03 22:33:50 +0000 2010:

> Ref http://bugs.sugarlabs.org/ticket/1976
Thanks for working on this!

> Bevaviour of the software is now independent of the hardware that Sugar is
> running. All registrations will look for Jabber server settings from
> /desktop/sugar/collaboration/jabber_server. However, this patch retains the
> REGISTER_URL as an option for systems administrators. This prevents
> currently written documentation for the XS / XO registration from breaking.
Administrators should not need to change the Sugar source code. For one
thing it will interact badly with package management systems.
Let's rather adjust the documentation.

> Please note, I haven't got an XS to test this on, so am relying on
> maintainter to see if this fixes the bug.
We're working on setting up a public XS instance for testing, but there are
security concerns. In the meantime you might try installing XS in a local
VM.

BTW: Please try out git send-email. It will send both the commit message
and the patch inline. This makes it easier to review because I don't
have to save the attachment and cut&paste it into the mail. It also means
the maintainer can apply your patch as-is, without needing to come
up with a commit message and fiddling with git options to set the
author.
If you need help setting up git send-email, feel free to ping me on
#sugar.


[src/jarabe/desktop/schoolserver.py]
> -REGISTER_URL = 'http://schoolserver:8080/'
> +REGISTER_URL = ''
> +# this setting is depreciated, consider changing XMPP settings
> +# in /desktop/sugar/collaboration/jabber_server
As mentioned above, let's drop this completely.
 
> +    setting_name = '/desktop/sugar/collaboration/jabber_server'
> +    jabber_server = client.get_string(setting_name)
> +    store_identifiers(sn, uuid_, jabber_server)
While you're at it, can you rename uuid_ to e.g. our_uuid, please?
A trailing underscore means "we don't use it" (but got it for one
reason or another, e.g. because the API of some other component
returned more information than we need).

> +    if len(url) == 0:
>          url = 'http://' + jabber_server + ':8080/'
The if won't be needed once you drop REGISTER_URL, but in general
I'd suggest to use "not url" instead as it will catch both an empty
value and None. Depending on what exactly you're testing against
there might even be a performance benefit, but it doesn't matter
for strings, lists or dictionaries (at least with CPython).

> +    else:
> +        url = url
Superfluous even before dropping REGISTER_URL.
 
Sascha

--
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100704/b9c6bb7c/attachment.pgp 


More information about the Sugar-devel mailing list