diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-10-08 15:28:32 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-10-08 15:28:32 (GMT) |
commit | ee4535c98ae74347e7072909d49dcf8a5e16ca7b (patch) | |
tree | 0eaed312fa906dbb3bcf451028b0088a106d3d5b /src/jarabe/journal/journalentrybundle.py | |
parent | 86e4ac242bf373a9a8dd85433647785f8d12fd23 (diff) |
Move to cjson and drop pyjson and simplejson
Diffstat (limited to 'src/jarabe/journal/journalentrybundle.py')
-rw-r--r-- | src/jarabe/journal/journalentrybundle.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/jarabe/journal/journalentrybundle.py b/src/jarabe/journal/journalentrybundle.py index 8862ca3..b3efe92 100644 --- a/src/jarabe/journal/journalentrybundle.py +++ b/src/jarabe/journal/journalentrybundle.py @@ -18,7 +18,7 @@ import os import tempfile import shutil -import json +import cjson import dbus from sugar.datastore import datastore @@ -72,12 +72,7 @@ class JournalEntryBundle(Bundle): if not os.path.exists(metadata_path): raise MalformedBundleException( 'Bundle must contain the file "_metadata.json"') - f = open(metadata_path, 'r') - try: - json_data = f.read() - finally: - f.close() - return json.read(json_data) + return cjson.decode(open(metadata_path, 'r').read()) def _read_preview(self, uid, bundle_dir): preview_path = os.path.join(bundle_dir, 'preview', uid) |