From 61ba2dd169ad05a9cc3eafd4aef1e0577950a563 Mon Sep 17 00:00:00 2001 From: b13rg <13488329+B13rg@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:24:58 -0700 Subject: [PATCH 1/4] Use flags instead of parameters in main.sh --- main.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.sh b/main.sh index 8f18fcba..d2ac692c 100755 --- a/main.sh +++ b/main.sh @@ -8,7 +8,7 @@ fi if [ "$DECOMPILE" = true ]; then cd src - python3 deadbot.py --decompile=true --deadbot=false + python3 deadbot.py --decompile cd .. fi @@ -23,7 +23,7 @@ fi if [ "$BOT_PUSH" = true ]; then cd src - python3 deadbot.py # uses BOT_PUSH env var + python3 deadbot.py --bot_push # uses BOT_PUSH env var cd .. fi From 09024116884d9432b5c45f7263aa1d63ad6829d3 Mon Sep 17 00:00:00 2001 From: b13rg <13488329+B13rg@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:25:07 -0700 Subject: [PATCH 2/4] add parenthesis for readability --- src/deadbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/deadbot.py b/src/deadbot.py index 0a843fdc..0d881735 100644 --- a/src/deadbot.py +++ b/src/deadbot.py @@ -102,13 +102,13 @@ def main(): 1, ] - if args.decompile or os.getenv('DECOMPILE', False) in true_args: + if args.decompile or (os.getenv('DECOMPILE', False) in true_args): print('Decompiling source files...') decompile.decompile(args.dl_path, args.workdir, args.output, args.decompiler_cmd) else: print('! Skipping Decompiler !') - if args.bot_push or os.getenv('BOT_PUSH', False) in true_args: + if args.bot_push or (os.getenv('BOT_PUSH', False) in true_args): print('Running DeadBot...') bot = DeadBot() bot.push_lane() From 8c52cf1485b2ed05d6f8add24d15a4bf9289644f Mon Sep 17 00:00:00 2001 From: b13rg <13488329+B13rg@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:31:18 -0700 Subject: [PATCH 3/4] Tweak parser localization parsing --- src/parser/parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser/parser.py b/src/parser/parser.py index 411ecd6a..bdeec482 100644 --- a/src/parser/parser.py +++ b/src/parser/parser.py @@ -88,9 +88,9 @@ def _merge_localizations(self, language, group, data): # duplicate key error. This is a temporary measure to keep patch updates going elif group != 'heroes': current_value = self.localizations[language][key] - raise Exception( - f'Key {key} with value {value} already exists in {language} localization ' - + f'data with value {current_value}.' + print( + f'Warning: In Key `{key}` with value `{value}` already exists in `{language}` localization ' + + f'data with value `{current_value}`.' ) def run(self): From 9d23e308dff7a1d73370dffb69e7036a6b89e349 Mon Sep 17 00:00:00 2001 From: b13rg <13488329+B13rg@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:35:05 -0700 Subject: [PATCH 4/4] Overwrite duplicate localization key --- src/parser/parser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parser/parser.py b/src/parser/parser.py index bdeec482..18122ad6 100644 --- a/src/parser/parser.py +++ b/src/parser/parser.py @@ -89,9 +89,10 @@ def _merge_localizations(self, language, group, data): elif group != 'heroes': current_value = self.localizations[language][key] print( - f'Warning: In Key `{key}` with value `{value}` already exists in `{language}` localization ' - + f'data with value `{current_value}`.' + f'Warning: In {language} localization under key `{key}`, ' + + f'value `{current_value}` was replaced with `{value}`.' ) + self.localizations[language][key] = value def run(self): print('Parsing...')