[Sugar-devel] [PATCH] Added Protected-Activities-Support to sugar (SL#2087)

Sascha Silbe sascha-ml-reply-to-2010-3 at silbe.org
Wed Sep 8 14:13:53 EDT 2010


Excerpts from Kandarp Kaushik's message of Wed Sep 08 19:13:38 +0200 2010:

> This patch provides a mechanism that uses a gconf value to determine
> which activities will not contain the erase option at the list view
> palette. The gconf value contains a list of activities bundle indentifiers.

s/at the list view palette/in the Home View/

The Home View might support additional layouts in the future that show
the erase option as well.

[data/sugar.schemas.in]
> +        <long>Users will not be allowed to erase these
> +        activities through the list view.</long>

Dito.

[src/jarabe/desktop/activitieslist.py]
> +        self._add_erase_option( registry, activity_info )

Please remove the extra spaces after / before parentheses. pylint would
have told you this.

> +        if not activity_info.is_user_activity():
> +            return
> +        if registry.is_activity_protected(self._bundle_id):
> +            return

A newline at this point (i.e. after the last guard) would improve
readability IMO.

[src/jarabe/model/bundleregistry.py]
> +        try:
> +            self._protected_activities = client.get_list('/desktop/sugar/protected_activities',

Line too long (80 chars is the limit). Just put the string literal on the
next line, indented by four additional spaces. If it fits, merge in the
remaining part.

> +                gconf.VALUE_STRING)
> +        except Exception:
> +            self._protected_activities = []

Please only catch specific exceptions, otherwise you might hide some
failures / bugs.

Have we reached consensus on the design, BTW? The patch still hides
the erase option instead of deactivating it.

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/20100908/d230c1ae/attachment.pgp 


More information about the Sugar-devel mailing list