From ee81d0497d102e0a749261fe5d23481f1d5d3cf3 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sun, 10 Oct 2010 12:40:57 +0000 Subject: add a newline between json blocks on dump; removing it on load --- (limited to 'TurtleArt') diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py index 5c4614c..8229166 100644 --- a/TurtleArt/tautils.py +++ b/TurtleArt/tautils.py @@ -165,7 +165,7 @@ def data_from_file(ta_file): def data_from_string(text): """ JSON load data from a string. """ - return json_load(text) + return json_load(text.replace(']],\n', ']], ')) def data_to_file(data, ta_file): """ Write data to a file. """ @@ -175,7 +175,7 @@ def data_to_file(data, ta_file): def data_to_string(data): """ JSON dump a string. """ - return json_dump(data) + return json_dump(data).replace(']], ', ']],\n') def do_dialog(dialog, suffix, load_save_folder): """ Open a file dialog. """ -- cgit v0.9.1