Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
GaelHF committed Feb 12, 2024
1 parent 7db4db4 commit 13e7a58
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Binary file removed __pycache__/module.cpython-311.pyc
Binary file not shown.
Binary file removed __pycache__/update.cpython-311.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
13 changes: 7 additions & 6 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
return str(version)

0 comments on commit 13e7a58

Please sign in to comment.