diff --git a/Updater/Updater.py b/Updater/Updater.py index adf478c..7b13c5f 100644 --- a/Updater/Updater.py +++ b/Updater/Updater.py @@ -15,9 +15,18 @@ try: URL = gitversion["download_bin"] dl = requests.get(URL, allow_redirects=True, stream=True) + dl_size = int(dl.headers["Content-Length"]) + with open("./download.zip", "wb") as file: print(f"Téléchargement de la version {gitversion['version']}.{gitversion['subversion']} en cours...") - for chunk in dl.iter_content(chunk_size=1024): file.write(chunk) + chunk_size = 1024 + for i, chunk in enumerate(dl.iter_content(chunk_size=chunk_size)): + progress = int((i * chunk_size * 100) / dl_size) + print("("+str(progress)+"%) | " + "#" * (progress//5) + "_"* (20 - (progress//5)) + " | " + + str(round(i*chunk_size/1000000,1)) + "Mo/" + str(round(dl_size/1000000,1)) + "Mo", end="\r") + file.write(chunk) + file.flush() + print("fin du téléchargement, début de l'extraction...") with zipfile.ZipFile("./download.zip") as file: diff --git a/Updater/Updater.zip b/Updater/Updater.zip index 7836093..dc449c2 100644 Binary files a/Updater/Updater.zip and b/Updater/Updater.zip differ diff --git a/Updater/build.bat b/Updater/build.bat index 7494a24..f301a05 100644 --- a/Updater/build.bat +++ b/Updater/build.bat @@ -1 +1,2 @@ -"../venv/Scripts/python.exe" "./setup.py" build \ No newline at end of file +"../venv/Scripts/python.exe" "./setup.py" build +pause \ No newline at end of file