Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Kaufmann <humitos@gmail.com>2012-08-09 13:13:50 (GMT)
committer Manuel Kaufmann <humitos@gmail.com>2012-08-09 13:13:50 (GMT)
commit4673e2e201aa7d9c8220177b790eab38d6c231a6 (patch)
treece67ab1007eedf96f675980796d97c789f65ab3e
parent614e0ea641adc5fa5624e7775bbfce4c28e2b667 (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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/book.py b/book.py
index 02b13a6..215a117 100644
--- a/book.py
+++ b/book.py
@@ -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']