diff options
-rw-r--r-- | utils/raspberrypi/ctt/ctt_pretty_print_json.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/utils/raspberrypi/ctt/ctt_pretty_print_json.py b/utils/raspberrypi/ctt/ctt_pretty_print_json.py index 73383ea0..18938c82 100644 --- a/utils/raspberrypi/ctt/ctt_pretty_print_json.py +++ b/utils/raspberrypi/ctt/ctt_pretty_print_json.py @@ -4,6 +4,8 @@ # # ctt_pretty_print_json.py - camera tuning tool JSON formatter +import sys + """ takes a collapsed json file and makes it more readable @@ -72,4 +74,10 @@ def pretty_print_json(str_in, output_filename): if __name__ == '__main__': - pretty_print_json("../ctt/ref_json/final_imx477.json", "pretty.json") + if len(sys.argv) != 2: + print("Usage: %s filename" % sys.argv[0]) + sys.exit(1) + + input_filename = sys.argv[1] + with open(input_filename, "r") as fin: + pretty_print_json(fin.read(), "pretty.json") |