From 76657553e5bd1879631af670b461256263e7acac Mon Sep 17 00:00:00 2001 From: KevinKor01 Date: Thu, 18 Sep 2025 00:19:13 +0300 Subject: [PATCH] Check version pt1 --- CLI/Init.py | 53 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/CLI/Init.py b/CLI/Init.py index 64172f7..b60c60f 100644 --- a/CLI/Init.py +++ b/CLI/Init.py @@ -106,25 +106,6 @@ def select_folder(): return folder_path -# [Update Functions] <------------------------------------------------------------------------------------------------------------ [Begin] - -def CheckForUpdate(log=False): - print("Connecting....") - print(f"Request Version from API@{TiropitCLI.url}") - response = requests.get(TiropitCLI.url + "/api/getTiropitVersion") - print(f"ResponseCode:{response.status_code}") - print(f"ResponseJSON:{response.json()}") - - - - -# [Update Functions] <-------------------------------------------------------------------------------------------------------------- [End] - - - - - - @@ -181,6 +162,40 @@ def loadConfig(): + + +# [Update Functions] <------------------------------------------------------------------------------------------------------------ [Begin] + +def CheckForUpdate(log=False): + print("Connecting....") + print(f"Request Version from API@{TiropitCLI.url}") + response = requests.get(TiropitCLI.url + "/api/getTiropitVersion") + print(f"ResponseCode:{response.status_code}") + data = response.json() + + + print(f"ResponseJSON:{data}") + version = float(data["Version"]) + currentVersion = float(Config.version) + print(f"Recieved Version {version} - Current Version {currentVersion}") + if version > currentVersion: + print(f"Downloading & Installing Update {version}") + + + +# [Update Functions] <-------------------------------------------------------------------------------------------------------------- [End] + + + + + + + + + + + + def disconnect(): Server.host = "0.0.0.0"