wynnbuilder-forked-for-changes/py_script/validate.py

13 lines
327 B
Python
Raw Normal View History

2021-01-29 23:10:29 +00:00
import json
2021-07-05 14:13:04 +00:00
import sys
2021-01-29 23:10:29 +00:00
2021-07-05 14:13:04 +00:00
with open(sys.argv[1]) as infile:
2021-01-29 23:10:29 +00:00
data = json.load(infile)
duplicate_map = dict()
for item in data["items"]:
if item["name"] in duplicate_map:
print("DUPLICATE: " + str(item["id"]) + " <-> " + str(duplicate_map[item["name"]]["id"]))
else:
duplicate_map[item["name"]] = item