From 69d7246513000a88bd903f3cf16497c1d5f9ff91 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 05 Mar 2009 02:17:47 +0000 Subject: Use simplejson instead of cjson --- (limited to 'document.py') 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']: -- cgit v0.9.1