diff options
author | Daniel Drake <dsd@laptop.org> | 2009-11-18 12:17:47 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2009-11-23 11:01:46 (GMT) |
commit | cff9e43527ead20b088a9bfc6bbf12b0827debfd (patch) | |
tree | b7e55fd146187bfca81a8ffccd36704fea0d93eb /src/jarabe/model/bundleregistry.py | |
parent | 03d80f06f184e1e1e4635f7eb284b15113126251 (diff) |
Revert "Move to cjson and drop pyjson and simplejson"
This reverts commit ee4535c98ae74347e7072909d49dcf8a5e16ca7b.
cjson has a big bug dealing with slashes, this is a significant
long-term bug and upstream has not been responsive other than
acknowledging it. This bug breaks journal entry bundles.
http://dev.sugarlabs.org/ticket/1553
Thanks to Martin Langhoff for identifying and researching this issue
Diffstat (limited to 'src/jarabe/model/bundleregistry.py')
-rw-r--r-- | src/jarabe/model/bundleregistry.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jarabe/model/bundleregistry.py b/src/jarabe/model/bundleregistry.py index b754952..aa49c72 100644 --- a/src/jarabe/model/bundleregistry.py +++ b/src/jarabe/model/bundleregistry.py @@ -21,7 +21,7 @@ import traceback import gobject import gio -import cjson +import simplejson from sugar.bundle.activitybundle import ActivityBundle from sugar.bundle.contentbundle import ContentBundle @@ -107,7 +107,7 @@ class BundleRegistry(gobject.GObject): def _load_favorites(self): favorites_path = env.get_profile_path('favorite_activities') if os.path.exists(favorites_path): - favorites_data = cjson.decode(open(favorites_path).read()) + favorites_data = simplejson.load(open(favorites_path)) favorite_bundles = favorites_data['favorites'] if not isinstance(favorite_bundles, dict): @@ -322,7 +322,7 @@ class BundleRegistry(gobject.GObject): path = env.get_profile_path('favorite_activities') favorites_data = {'defaults-mtime': self._last_defaults_mtime, 'favorites': self._favorite_bundles} - open(path, 'w').write(cjson.encode(favorites_data)) + simplejson.dump(favorites_data, open(path, 'w'), indent=1) def is_installed(self, bundle): # TODO treat ContentBundle in special way |