Check version pt1
This commit is contained in:
53
CLI/Init.py
53
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"
|
||||
|
||||
Reference in New Issue
Block a user