diff options
author | Walter 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) |
commit | f84386784d4f447fb20b00bceb5f2f731e45c65b (patch) | |
tree | e4395390c5ccc9510eeae089135129987e6ee2d1 /utils.py | |
parent | 0279518276390439777a351a770c9e98b23d6ab3 (diff) |
on the path to sharing
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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') + |