Open fhdk opened 6 days ago
A hardcoded 4 space can look awkward - so adding an indentation property defaulting to 4 makes it possible to use another value in the call.
diff --git a/mdd.py b/mdd.py index cb9f3c1..cfb1de8 100644 --- a/mdd.py +++ b/mdd.py @@ -24,8 +24,8 @@ from dateutil import parser as date_parser inxi = None -def json_beaut(input, sort_keys=False): - return json.dumps(input, indent=4, sort_keys=sort_keys) +def json_beaut(input, sort_keys=False, indent=4): + return json.dumps(input, indent=indent, sort_keys=sort_keys) def prepare_inxi():
refactor-to-flexible-json-indent.txt
A hardcoded 4 space can look awkward - so adding an indentation property defaulting to 4 makes it possible to use another value in the call.
refactor-to-flexible-json-indent.txt