Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()