0
0
mirror of https://github.com/HamletDuFromage/switch-cheats-db.git synced 2025-04-24 08:25:17 +00:00
switch-cheats-db/build_changelog.py

19 lines
442 B
Python

#!/usr/bin/env python3
import sys
import json
import re
with open("versions.json", "r") as versions_file:
versions = json.load(versions_file)
for line in sys.argv:
try:
tid = re.search("cheats/(.+)\.json", line).group(1)
if tid in versions and "title" in versions[tid]:
print(f"{tid} | {versions[tid]['title']}")
else:
print(tid)
except (TypeError, AttributeError):
pass