sqlalchemy ORM models for quest databases and json parsing scripts

also minor bugfixes
next is testing and implementation
This commit is contained in:
louis 2019-05-15 12:32:33 -04:00
parent 6c455fe30b
commit 8b7815500e
10 changed files with 267 additions and 15 deletions

View file

@ -13,22 +13,20 @@ def update_names(dir_in, old_path, languages):
# we have to update japanese like the rest because CustomData exists
# and POKELABO deleted the wedding gear event stuff from the game files
for x in languages:
langfile = os.path.join(old_path, "nametranslations_{}.json".format(x))
if os.path.isfile(langfile):
with open(langfile, "r") as lang_file:
lang_dict = json.load(lang_file)
if x == "jpn":
out_dict = dict(zip(names, names)).update(lang_dict)
else:
out_dict = dict.fromkeys(names, "").update(lang_dict)
elif x == "jpn": # bootstrap
for l in languages:
if l == "jpn":
out_dict = dict(zip(names, names))
else:
out_dict = dict.fromkeys(names, "")
langfile = os.path.join(old_path, "nametranslations_{}.json".format(l))
if os.path.isfile(langfile):
with open(langfile, "r") as lang_file:
lang_dict = json.load(lang_file)
out_dict.update(lang_dict)
with io.open(langfile, "w", newline='\n') as lang_file: # you're using git right
json.dump(lang_dict, lang_file, ensure_ascii=False, indent='\t', sort_keys=True)
json.dump(out_dict, lang_file, ensure_ascii=False, indent='\t', sort_keys=True)
def extract_names(dir_in):
char_tsv_path = os.path.join(dir_in, "Diva", "Settings", "Character.tsv")