From df83fc81f2a628dcc3498d30ee21328dc9071aae Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Wed, 1 Sep 2021 10:58:15 +0200 Subject: [PATCH] added scripts to update my default score to old_notation (file used by the bot game review to keep notation from older channels) --- scripts/add_my_score_to_old_notation.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/add_my_score_to_old_notation.py diff --git a/scripts/add_my_score_to_old_notation.py b/scripts/add_my_score_to_old_notation.py new file mode 100644 index 0000000..c576489 --- /dev/null +++ b/scripts/add_my_score_to_old_notation.py @@ -0,0 +1,17 @@ +import os +import json +os.chdir("..") +from source.CT_Config import CT_Config + +ct_config = CT_Config() +ct_config.load_ctconfig_file() + +with open(r"..\GameReview\MKWF\old_notation.json", "r", encoding="utf8") as f: + old_n = json.load(f) + +track_list = list(filter(lambda x: x.since_version == "0.10", ct_config.unordered_tracks)) +for track in track_list: + old_n[track.sha1] = {"216179546427359232": track.score} + +with open(r"..\GameReview\MKWF\old_notation.json", "w", encoding="utf8") as f: + json.dump(old_n, f, ensure_ascii=False)