[sugar] [PATCH] Merge activities.default into favorites.
Simon Schampijer
simon at schampijer.de
Mon May 19 08:54:35 EDT 2008
Hi,
following small note to the patch:
what about using an else clause in the _load_favorites() method? So we know which
ValueError the except block is trying to catch.
try:
favorites_data = simplejson.load(open(favorites_path))
except ValueError, e:
logging.error('Error while loading favorite_activities: %r.' %
e)
else:
# Old structure was a list instead of a dictionary.
if isinstance(favorites_data, list):
favorite_bundles = favorites_data
else:
favorite_bundles = favorites_data['favorites']
self._last_defaults_mtime = favorites_data['defaults-mtime']
But r+ in general.
Best,
Simon
More information about the Sugar
mailing list