Don't pretty print json files

The json file outputs of e-r are loaded by web browsers in order to
render our graphs. These json files are actually quite large and part of
the reason why is we pretty print them with 4 space indents and they
have large nesting. Stop pretty printing (humans can pass the files
through a filter if necessary) in order to reduce the size of these
files and make browsers happier (less time spent downloading).

Change-Id: I19dedc2994169932eb0e90b6cdea3856637f5ef0
This commit is contained in:
Clark Boylan 2020-01-29 10:05:38 -08:00
parent 265217b0cc
commit 94ab7eb16b
1 changed files with 1 additions and 3 deletions

View File

@ -243,9 +243,7 @@ def main():
out = sys.stdout
try:
# indent the json output if we're writing to a file
indent = 4 if args.output else None
out.write(json.dumps(jsondata, indent=indent))
out.write(json.dumps(jsondata))
finally:
out.close()