diff --git a/__pycache__/module.cpython-311.pyc b/__pycache__/module.cpython-311.pyc deleted file mode 100644 index 1e5ae72..0000000 Binary files a/__pycache__/module.cpython-311.pyc and /dev/null differ diff --git a/__pycache__/update.cpython-311.pyc b/__pycache__/update.cpython-311.pyc deleted file mode 100644 index 2eadb70..0000000 Binary files a/__pycache__/update.cpython-311.pyc and /dev/null differ diff --git a/app.py b/app.py index 81c99c2..288378f 100644 --- a/app.py +++ b/app.py @@ -94,7 +94,8 @@ def change_keyboard(): change_button = ctk.CTkButton(app, text="Change Keyboard", command=change_keyboard).pack(padx=60, pady=3) if update.is_update_available(): - current_keyboard_label = ctk.CTkLabel(master=app, text=f"An update is available ! ({update.get_new_version()})", width=20) + new_version = ctk.CTkLabel(master=app, text=f"An update is available ! ({update.get_new_version()})", width=20) + new_version.pack(side="top", padx=(10, 10), pady=(10, 10)) pygame.init() diff --git a/update.py b/update.py index 8a38fb2..ffd761c 100644 --- a/update.py +++ b/update.py @@ -2,22 +2,23 @@ import json current_version = "v1.5.0" -current_version = current_version.replace("v", "") -current_version = current_version.replace(".", "") +current_version_m = current_version.replace("v", "") +current_version_m = current_version_m.replace(".", "") request = requests.get("https://api.github.com/repos/gaelhf/mechanik/releases/latest") data = request.content data = json.loads(data) version = data["tag_name"] -version = version.replace("v", "") -version = version.replace(".", "") + +version_m = version.replace(".", "") +version_m = version_m.replace("v", "") def is_update_available(): - if int(version) > int(current_version): + if int(version_m) > int(current_version_m): return True else: return False def get_new_version(): - return int(version) \ No newline at end of file + return str(version) \ No newline at end of file