Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tautils.py
diff options
context:
space:
mode:
authorPootle daemon <pootle@pootle.sugarlabs.org>2012-06-30 04:31:58 (GMT)
committer Pootle daemon <pootle@pootle.sugarlabs.org>2012-06-30 04:31:58 (GMT)
commit261c7324995e808fb3d781b66ac18634c7e78f14 (patch)
treeb82e2acf6de8ec8b41c295f6e5557beb2f50ef0b /TurtleArt/tautils.py
parentc413529f53e333d1871825c9520cf79bb70484a2 (diff)
parentab4e5279bd1511c134bdcca83895edc8f6c33cb8 (diff)
Merge branch 'master' of git.sugarlabs.org:turtleart/mainline
Diffstat (limited to 'TurtleArt/tautils.py')
-rw-r--r--TurtleArt/tautils.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py
index 40c39e9..d60884e 100644
--- a/TurtleArt/tautils.py
+++ b/TurtleArt/tautils.py
@@ -235,8 +235,15 @@ def data_from_file(ta_file):
def data_from_string(text):
''' JSON load data from a string. '''
- return json_load(text.replace(']],\n', ']], '))
-
+ if type(text) == str:
+ return json_load(text.replace(']],\n', ']], '))
+ else:
+ print type(text), text
+ if hasattr('replace', text):
+ return json_load(text.replace(']],\n', ']], '))
+ else:
+ print 'type error in data_from_string'
+ return ''
def data_to_file(data, ta_file):
''' Write data to a file. '''