Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-03-05 17:53:21 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-03-05 17:53:21 (GMT)
commit0adfd2167fa4b7aa2c3be8a2642f11bc2b41867c (patch)
tree53e058164a70227fea1717f7e9f7955b1b478345
parent8d4aed498665c0eb1c9e78448979d6f15a91a058 (diff)
Use simplejson instead of json-py to satisfy python26
-rwxr-xr-xcolors.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/colors.py b/colors.py
index 0ccdd7e..457888a 100755
--- a/colors.py
+++ b/colors.py
@@ -29,9 +29,15 @@
# Sharing - http://wiki.laptop.org/go/Shared_Sugar_Activities
# Import standard Python modules.
-import logging, os, math, time, copy, json, tempfile
+import logging, os, math, time, copy, tempfile
from gettext import gettext as _
+try:
+ import json
+ json.dumps
+except (ImportError, AttributeError):
+ import simplejson as json
+
# Import the C++ component of the activity.
from colorsc.colorsc import *
@@ -581,7 +587,7 @@ class Colors(activity.Activity, ExportedGObject):
samples = []
fd = open(activity.get_bundle_path() + '/data/INDEX', 'r')
try:
- samples = json.read(fd.read())
+ samples = json.loads(fd.read())
finally:
fd.close()