Skip to content

Commit a654dbf

Browse files
authored
Create update.py
1 parent 82d5dc1 commit a654dbf

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

src/update.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import requests
2+
from debug import debug_print
3+
4+
UPDATE_URL = 'https://raw.githubusercontent.com/rompelhd/AdminFreeExec/refs/heads/main/version'
5+
CURRENT_VERSION = '0.2.1'
6+
LATEST_VERSION = None
7+
8+
def check_update_applicationfor_update():
9+
response = requests.get(UPDATE_URL)
10+
response.raise_for_status()
11+
12+
LATEST_VERSION = response.text.strip()
13+
debug_print(f"Response status code: {response.status_code} Latest version fetched: {LATEST_VERSION}", "INFO")
14+
15+
16+
def result_update():
17+
try:
18+
if LATEST_VERSION != CURRENT_VERSION:
19+
return True
20+
return False
21+
except Exception as e:
22+
debug_print(f"Error checking for update: {e}", "ERROR")
23+
return False
24+
25+
def update_application():
26+
debug_print(f"Actualizando", "INFO")

0 commit comments

Comments
 (0)