Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/document.py
diff options
context:
space:
mode:
Diffstat (limited to 'document.py')
-rw-r--r--document.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/document.py b/document.py
index 9273f2c..d3ba739 100644
--- a/document.py
+++ b/document.py
@@ -14,9 +14,14 @@
import os
import gtk
-import cjson
from zipfile import ZipFile
+try:
+ import json
+ json.dumps
+except (ImportError, AttributeError):
+ import simplejson as json
+
import theme
from sound import *
from ground import *
@@ -70,7 +75,7 @@ def save(filepath):
node['index'] = i
cfg['tape'].append(node)
- zip.writestr('MANIFEST', cjson.encode(cfg))
+ zip.writestr('MANIFEST', json.dumps(cfg))
zip.close()
import shutil
@@ -78,7 +83,7 @@ def save(filepath):
def load(filepath):
zip = ZipFile(filepath, 'r')
- cfg = cjson.decode(zip.read('MANIFEST'))
+ cfg = json.loads(zip.read('MANIFEST'))
def _load(node, restored_class, preinstalled_class):
if node['custom']: