translated to english

This commit is contained in:
raphael60650 2021-07-14 14:45:32 +02:00
parent 2c41c0f04c
commit a92ae5bebe
2 changed files with 11 additions and 13 deletions

View file

@ -5,7 +5,7 @@ import sys
Dir, ext = os.path.splitext(sys.argv[0])
if ext == ".py":
input("Ce code ne doit être lancé que sous sa forme .exe !")
input("This code need to be started from its .exe version !")
exit()
VERSION_FILE_URL = "https://raw.githubusercontent.com/Faraphel/MKWF-Install/master/version"
@ -18,28 +18,26 @@ try:
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...")
print(f"Downloading version {gitversion['version']}.{gitversion['subversion']}...")
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")
print("("+str(progress)+"%) | " + "#" * (progress//5) + "_" * (20 - (progress//5)) + " | " +
str(round(i*chunk_size/1000000,1)) + "Mo/" + str(round(dl_size/1000000,1)) + "Mo" + " " * 10,
end="\r")
file.write(chunk)
file.flush()
print("fin du téléchargement, début de l'extraction...")
print("end of the download, starting extraction..." + (" " * 10))
with zipfile.ZipFile("./download.zip") as file:
file.extractall("./")
print("fin de l'extraction")
print("end of extraction")
os.remove("./download.zip")
print("lancement de l'application...")
print("restarting application...")
os.startfile(os.path.realpath("./MKWF-Install.exe"))
except Exception as e:
print(f"Impossible d'effectuer la mise à jour :\n\n{str(e)}")
input("Appuyez pour continuer...")
# TODO: Use requests.get("https://api.github.com/repos/Faraphel/MKWF-Install/git/trees/master?recursive=1") to avoid
# redownloading the same files again and again
print(f"Can't update :\n\n{str(e)}")
input("Press to close...")

View file

@ -16,7 +16,7 @@ setup(
license='GPL-3.0',
author='Faraphel',
author_email='rc60650@hotmail.com',
description='Logiciel de mise à jour pour MKWF-Install.',
description='MKWF-Install Updater.',
executables = [Executable("./Updater.py",
target_name = "Updater.exe",
shortcut_name = "MKWF-Install Updater",