From 80582311e13d6f5c8a0f0a50ca00c873cfabcfb8 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Sun, 21 Nov 2021 00:27:13 +0100 Subject: [PATCH] fixed an issue with a non-existing button trying to be updated and an error with the returned value of get_next_available_dir --- source/Game.py | 4 ---- source/definition.py | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/source/Game.py b/source/Game.py index c77703d..26d2fbd 100644 --- a/source/Game.py +++ b/source/Game.py @@ -449,10 +449,6 @@ class Game: self.patch_autoadd() self.patch_tracks() - self.gui.button_install_mod.grid(row=2, column=1, columnspan=2, sticky="NEWS") - self.gui.button_install_mod.config( - text=self.gui.translate("Install mod", " (v", self.ctconfig.version, ")")) - except: self.gui.log_error() finally: diff --git a/source/definition.py b/source/definition.py index a318969..d9a3263 100644 --- a/source/definition.py +++ b/source/definition.py @@ -140,8 +140,8 @@ def get_next_available_dir(parent_dir: str, dir_name: str) -> str: final_dir_name = dir_name while True: path_dir = os.path.realpath(parent_dir + "/" + final_dir_name) - if not os.path.exists(path_dir): break + if not os.path.exists(path_dir): return path_dir final_dir_name = f"{dir_name} ({i})" i += 1 - return parent_dir + "/" + final_dir_name +