1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-14 08:17:13 +03:00

Made json output easier to work with

This commit is contained in:
A_D 2021-06-06 12:35:31 +02:00
parent dbea29194b
commit 0c5806e12c
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -128,18 +128,19 @@ if __name__ == '__main__':
print(f"No longer used: {old}")
elif args.json:
to_print = json.dumps({
str(path): [{
to_print_data = [
{
"path": str(path),
"string": get_arg(c),
"reconstructed": ast.unparse(c),
"start_line": c.lineno,
"start_offset": c.col_offset,
"end_line": c.end_lineno,
"end_offset": c.end_col_offset,
} for c in calls] for (path, calls) in res.items() if len(calls) > 0
}, indent=2)
} for (path, calls) in res.items() for c in calls
]
print(to_print)
print(json.dumps(to_print_data, indent=2))
elif args.lang:
for path, calls in res.items():