New version
This commit is contained in:
@@ -5,6 +5,7 @@ import io
|
|||||||
|
|
||||||
class auto_updater:
|
class auto_updater:
|
||||||
dl_version = 0
|
dl_version = 0
|
||||||
|
temp_dir = ""
|
||||||
|
|
||||||
def clean(self, str):
|
def clean(self, str):
|
||||||
str = str.replace('/','')
|
str = str.replace('/','')
|
||||||
@@ -25,8 +26,8 @@ class auto_updater:
|
|||||||
|
|
||||||
ssl._create_default_https_context = ssl._create_unverified_context
|
ssl._create_default_https_context = ssl._create_unverified_context
|
||||||
if self.dl_version != VERSION:
|
if self.dl_version != VERSION:
|
||||||
print(f"Version différente trouvée {self.dl_version} téléchargement en cours")
|
print(f"Version différente trouvée {self.dl_version} téléchargement en cours => {self.temp_dir}update.exe")
|
||||||
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")
|
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")
|
||||||
ret = True
|
ret = True
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|||||||
7
main.py
7
main.py
@@ -27,6 +27,7 @@ from version import *
|
|||||||
|
|
||||||
src_dir = os.getenv('APPDATA') + "\Attrib2Biz\src"
|
src_dir = os.getenv('APPDATA') + "\Attrib2Biz\src"
|
||||||
dest_dir = os.getenv('APPDATA') + "\Attrib2Biz\output"
|
dest_dir = os.getenv('APPDATA') + "\Attrib2Biz\output"
|
||||||
|
temp_dir = os.getenv('APPDATA') + '\Attrib2Biz\.temp'
|
||||||
file_path ="" #os.path.dirname(__file__)
|
file_path ="" #os.path.dirname(__file__)
|
||||||
|
|
||||||
Elements = []
|
Elements = []
|
||||||
@@ -40,6 +41,9 @@ if not os.path.exists(src_dir):
|
|||||||
if not os.path.exists(dest_dir):
|
if not os.path.exists(dest_dir):
|
||||||
os.makedirs(dest_dir)
|
os.makedirs(dest_dir)
|
||||||
|
|
||||||
|
if not os.path.exists(temp_dir):
|
||||||
|
os.makedirs(temp_dir)
|
||||||
|
|
||||||
|
|
||||||
class SuggestionPopup(Toplevel):
|
class SuggestionPopup(Toplevel):
|
||||||
x_row = 0
|
x_row = 0
|
||||||
@@ -319,10 +323,11 @@ class ClercAttrib2Biz():
|
|||||||
self.thread = Thread(target=self.start_parsing)
|
self.thread = Thread(target=self.start_parsing)
|
||||||
|
|
||||||
auto_update = auto_updater()
|
auto_update = auto_updater()
|
||||||
|
auto_update.temp_dir = temp_dir + '\\'
|
||||||
if auto_update.new_update_available():
|
if auto_update.new_update_available():
|
||||||
self.logger.warning(f"Nouvelle version du script disponible. {auto_update.dl_version}")
|
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 !", ):
|
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()
|
self.fenetre.destroy()
|
||||||
|
|
||||||
def disable_prompt(self):
|
def disable_prompt(self):
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
VERSION = "20220606-1715"
|
VERSION = "20220606-1728"
|
||||||
Reference in New Issue
Block a user