diff options
author | Manuel Kaufmann <humitos@gmail.com> | 2012-08-09 13:13:50 (GMT) |
---|---|---|
committer | Manuel Kaufmann <humitos@gmail.com> | 2012-08-09 13:13:50 (GMT) |
commit | 4673e2e201aa7d9c8220177b790eab38d6c231a6 (patch) | |
tree | ce67ab1007eedf96f675980796d97c789f65ab3e | |
parent | 614e0ea641adc5fa5624e7775bbfce4c28e2b667 (diff) |
Use json as included in Python SL #3142
We use json as included in Python. This will make Sugar dependent on
Python 2.6 and Python 2.7 to have the highest JSON performance.
-rw-r--r-- | book.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -16,7 +16,7 @@ import os import uuid import logging from gi.repository import GObject -import cjson +import json import shutil import zipfile from gettext import gettext as _ @@ -122,7 +122,7 @@ class Book(GObject.GObject): 'revision' : self.revision } index = file(os.path.join(self.root, 'index'), 'w') - index.write(cjson.encode(data)) + index.write(json.dumps(data)) index.close() def sync(self): @@ -140,7 +140,7 @@ class Book(GObject.GObject): if os.path.exists(self.root): try: index = file(os.path.join(self.root, 'index'), 'r') - data = cjson.decode(index.read()) + data = json.loads(index.read()) self.uid = data['uid'] self.index = data['index'] self.revision = data['revision'] |