From 8adbfd49c137586334d9dfa272271474e1339f28 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Fri, 18 Jun 2021 11:42:47 +0200 Subject: [PATCH] added option, moved listbox to a menubar --- source/get_github_file.py | 2 ++ source/install_mod.py | 2 +- source/patch_file.py | 3 +-- source/patch_track.py | 9 +++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/get_github_file.py b/source/get_github_file.py index 86d221b..4db8a2d 100644 --- a/source/get_github_file.py +++ b/source/get_github_file.py @@ -6,6 +6,8 @@ root = "https://raw.githubusercontent.com/Faraphel/MKWF-Install/master/" def get_github_file(self, file): try: + if self.boolvar_disable_download.get(): return 2 + dl = requests.get(root+file, allow_redirects=True, stream=True) if os.path.exists(file): if int(dl.headers['Content-Length']) == os.path.getsize(file): diff --git a/source/install_mod.py b/source/install_mod.py index 3e5d33a..784af07 100644 --- a/source/install_mod.py +++ b/source/install_mod.py @@ -105,7 +105,7 @@ def install_mod(self): shutil.rmtree(self.path_mkwf + "/tmp/") - outputformat = self.listbox_outputformat.get() + outputformat = self.stringvar_game_format.get() self.Progress(statut=self.translate("Conversion en")+f" {outputformat}", add=1) if outputformat in ["ISO", "WBFS", "CISO"]: diff --git a/source/patch_file.py b/source/patch_file.py index 256e68c..e2f2f57 100644 --- a/source/patch_file.py +++ b/source/patch_file.py @@ -24,8 +24,7 @@ def patch_file(self): self.patch_autoadd() self.patch_track(tracks, total_track) - self.button_install_mod.grid(row=2, column=1, sticky="NEWS") - self.listbox_outputformat.grid(row=2, column=2, sticky="NEWS") + self.button_install_mod.grid(row=2, column=1, columnspan=2, sticky="NEWS") except: self.log_error() finally: self.Progress(show=False) diff --git a/source/patch_track.py b/source/patch_track.py index accbfd3..19f1226 100644 --- a/source/patch_track.py +++ b/source/patch_track.py @@ -29,7 +29,7 @@ def patch_autoadd(self): def patch_track(self, tracks, total_track="?"): - max_process = 8 + max_process = self.intvar_process_track.get() process_list = {} error_count, error_max = 0, 3 @@ -42,7 +42,7 @@ def patch_track(self, tracks, total_track="?"): while True: if len(process_list) < max_process: - process_list[track_szs_file] = None + process_list[(track_szs_file, track_wu8_file)] = None self.Progress(statut=self.translate("Conversion des courses") + f"\n({i + 1}/{total_track})\n" + "\n".join([get_nodir(file) for file in process_list.keys()]), add=1) @@ -66,13 +66,13 @@ def patch_track(self, tracks, total_track="?"): str(error_count) + "/" + str(error_max) + ")") if not (os.path.exists(track_szs_file)): - process_list[track_szs_file] = subprocess.Popen([ + process_list[(track_szs_file, track_wu8_file)] = subprocess.Popen([ "./tools/szs/wszst", "NORMALIZE", track_wu8_file, "--DEST", "./file/Track/%N.szs", "--szs", "--overwrite", "--autoadd-path", "./file/auto-add/"], creationflags=CREATE_NO_WINDOW, stderr=subprocess.PIPE) break else: - for process in process_list: + for (track_szs_file, track_wu8_file), process in process_list.items: if process_list[process] is not None: returncode = process_list[process].poll() if returncode is None: @@ -98,6 +98,7 @@ def patch_track(self, tracks, total_track="?"): break else: + if self.boolvar_del_track_after_conv.get(): os.remove(track_wu8_file) process_list.pop(process) break else: