diff --git a/ever2simple/converter.py b/ever2simple/converter.py index 4a3f849..d82011d 100644 --- a/ever2simple/converter.py +++ b/ever2simple/converter.py @@ -106,14 +106,14 @@ def _convert_csv(self, notes): def _convert_json(self, notes): if self.simple_filename is None: - sys.stdout.write(json.dumps(notes)) + sys.stdout.write(json.dumps(notes, sort_keys=True, indent=4, separators=(',', ': '))) else: with open(self.simple_filename, 'w') as output_file: - json.dump(notes, output_file) + json.dump(notes, output_file, sort_keys=True, indent=4, separators=(',', ': ')) def _convert_dir(self, notes): if self.simple_filename is None: - sys.stdout.write(json.dumps(notes)) + sys.stdout.write(json.dumps(notes, sort_keys=True, indent=4, separators=(',', ': '))) else: if os.path.exists(self.simple_filename) and not os.path.isdir(self.simple_filename): print '"%s" exists but is not a directory. %s' % self.simple_filename