From fef8250581666caf5fa1171f4c2060a328560cfa Mon Sep 17 00:00:00 2001 From: John Henry Beale Date: Fri, 15 May 2026 13:38:11 +0200 Subject: [PATCH] commented out iterencode function within MyJsonEncoder as it reformated the json as a single line and made it hard to read --- ModuleFixTarget.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ModuleFixTarget.py b/ModuleFixTarget.py index 3e706f5..edb9b49 100644 --- a/ModuleFixTarget.py +++ b/ModuleFixTarget.py @@ -47,21 +47,21 @@ class MyJsonEncoder(json.JSONEncoder): return repr(obj) return json.JSONEncoder.default(self, obj) - def iterencode(self, o, _one_shot=False): - list_lvl = 0 - l=super().iterencode(o, _one_shot=_one_shot) - #l=tuple(l);print(''.join(l)) # helpful to debug - for s in l: - if s.startswith('['): - list_lvl += 1 - if list_lvl > 0: - s = s[0]+s[1:].replace('\n', '').strip() - s = s.replace('\n', '').rstrip() - #self.item_separator): - #self.key_separator - if s.endswith(']'): - list_lvl -= 1 - yield s +# def iterencode(self, o, _one_shot=False): +# list_lvl = 0 +# l=super().iterencode(o, _one_shot=_one_shot) +# #l=tuple(l);print(''.join(l)) # helpful to debug +# for s in l: +# if s.startswith('['): +# list_lvl += 1 +# if list_lvl > 0: +# s = s[0]+s[1:].replace('\n', '').strip() +# s = s.replace('\n', '').rstrip() +# #self.item_separator): +# #self.key_separator +# if s.endswith(']'): +# list_lvl -= 1 +# yield s def MyJsonDecoder(dct): if isinstance(dct, dict):