Compare commits
8 Commits
20220606-1
...
20220606-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3c4ab9e0b | ||
|
|
bb57b3edff | ||
|
|
ab248478c0 | ||
|
|
2a1fcd7437 | ||
| 49297d23ef | |||
|
|
8995d412f9 | ||
|
|
b8bca94f65 | ||
|
|
e3c4ee9d3e |
@@ -5,6 +5,7 @@ import io
|
||||
|
||||
class auto_updater:
|
||||
dl_version = 0
|
||||
temp_dir = ""
|
||||
|
||||
def clean(self, str):
|
||||
str = str.replace('/','')
|
||||
@@ -25,8 +26,12 @@ class auto_updater:
|
||||
|
||||
ssl._create_default_https_context = ssl._create_unverified_context
|
||||
if self.dl_version != VERSION:
|
||||
print(f"Version différente trouvée {self.dl_version} téléchargement en cours")
|
||||
urllib.request.urlretrieve(url=f"https://gitea.prod.resk-u.ch/CLERC/AttribWinbiz/releases/download/{self.clean(self.dl_version)}/Clercattrib2Biz_setup.exe", filename="update.exe")
|
||||
print(f"Version différente trouvée {self.dl_version} téléchargement en cours => {self.temp_dir}update.exe")
|
||||
try:
|
||||
urllib.request.urlretrieve(url=f"https://gitea.prod.resk-u.ch/CLERC/AttribWinbiz/releases/download/{self.clean(self.dl_version)}/Clercattrib2Biz_setup.exe", filename=f"{self.temp_dir}update.exe")
|
||||
except:
|
||||
print("ERREUR de téléchargement mise à jours")
|
||||
return "ERROR"
|
||||
ret = True
|
||||
return ret
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
20220606-1715
|
||||
20220606-1735
|
||||
12
main.py
12
main.py
@@ -27,6 +27,7 @@ from version import *
|
||||
|
||||
src_dir = os.getenv('APPDATA') + "\Attrib2Biz\src"
|
||||
dest_dir = os.getenv('APPDATA') + "\Attrib2Biz\output"
|
||||
temp_dir = os.getenv('APPDATA') + '\Attrib2Biz\.temp'
|
||||
file_path ="" #os.path.dirname(__file__)
|
||||
|
||||
Elements = []
|
||||
@@ -40,6 +41,9 @@ if not os.path.exists(src_dir):
|
||||
if not os.path.exists(dest_dir):
|
||||
os.makedirs(dest_dir)
|
||||
|
||||
if not os.path.exists(temp_dir):
|
||||
os.makedirs(temp_dir)
|
||||
|
||||
|
||||
class SuggestionPopup(Toplevel):
|
||||
x_row = 0
|
||||
@@ -319,11 +323,15 @@ class ClercAttrib2Biz():
|
||||
self.thread = Thread(target=self.start_parsing)
|
||||
|
||||
auto_update = auto_updater()
|
||||
if auto_update.new_update_available():
|
||||
auto_update.temp_dir = temp_dir + '\\'
|
||||
update_available = auto_update.new_update_available()
|
||||
if update_available == True:
|
||||
self.logger.warning(f"Nouvelle version du script disponible. {auto_update.dl_version}")
|
||||
if messagebox.askyesno(title="Nouvelle version trouvée", message=f"Une nouvelle version a été trouvée, vous pouvez l'installer dès maintenant !", ):
|
||||
subprocess.call("update.exe")
|
||||
subprocess.call(temp_dir + "\\update.exe")
|
||||
self.fenetre.destroy()
|
||||
elif update_available == "ERROR":
|
||||
messagebox.showerror(title="ERREUR téléchargement", message="Erreur lors du téléchargement de la nouvelle mise à jour")
|
||||
|
||||
def disable_prompt(self):
|
||||
self.prompt.destroy()
|
||||
|
||||
@@ -1 +1 @@
|
||||
VERSION = "20220606-1715"
|
||||
VERSION = "20220606-1729"
|
||||
Reference in New Issue
Block a user