From e8655c2161a97261971ef19621a34651980b76d6 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 2 May 2020 03:32:00 +0300 Subject: utils: raspberrypi: ctt: Fix pycodestyle E302 E302 expected 2 blank lines, found 0 Note that issues are still flagged, due to the use of docstrings as multi-lines comments. This will be addressed separately. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: David Plowman --- utils/raspberrypi/ctt/ctt_pretty_print_json.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'utils/raspberrypi/ctt/ctt_pretty_print_json.py') diff --git a/utils/raspberrypi/ctt/ctt_pretty_print_json.py b/utils/raspberrypi/ctt/ctt_pretty_print_json.py index fac9e98b..73383ea0 100644 --- a/utils/raspberrypi/ctt/ctt_pretty_print_json.py +++ b/utils/raspberrypi/ctt/ctt_pretty_print_json.py @@ -4,6 +4,7 @@ # # ctt_pretty_print_json.py - camera tuning tool JSON formatter + """ takes a collapsed json file and makes it more readable """ @@ -11,10 +12,12 @@ def process_file(string, fout, state): for c in string: process_char(c, fout, state) + def print_newline(fout, state): fout.write('\n') fout.write(' '*state["indent"]*4) + def process_char(c, fout, state): if c == '{': if not state["skipnewline"]: @@ -61,6 +64,7 @@ def process_char(c, fout, state): fout.write(c) state["skipnewline"] = (c == '[') + def pretty_print_json(str_in, output_filename): state = {"indent": 0, "inarray": [False], "arraycount": [], "skipnewline": True} with open(output_filename, "w") as fout: -- cgit v1.2.1