Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-03-15 01:35:40 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-03-15 01:35:40 (GMT)
commitf84386784d4f447fb20b00bceb5f2f731e45c65b (patch)
treee4395390c5ccc9510eeae089135129987e6ee2d1 /utils.py
parent0279518276390439777a351a770c9e98b23d6ab3 (diff)
on the path to sharing
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 39298e3..ae689d7 100644
--- a/utils.py
+++ b/utils.py
@@ -54,3 +54,11 @@ def json_dump(data):
jdump(data, _io)
return _io.getvalue()
+def data_from_string(text):
+ """ JSON load data from a string. """
+ return json_load(text.replace(']],\n', ']], '))
+
+def data_to_string(data):
+ """ JSON dump a string. """
+ return json_dump(data).replace(']], ', ']],\n')
+