mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 19:28:25 +02:00
added option, moved listbox to a menubar
This commit is contained in:
parent
f9f1558a60
commit
8adbfd49c1
4 changed files with 9 additions and 7 deletions
|
@ -6,6 +6,8 @@ root = "https://raw.githubusercontent.com/Faraphel/MKWF-Install/master/"
|
||||||
|
|
||||||
def get_github_file(self, file):
|
def get_github_file(self, file):
|
||||||
try:
|
try:
|
||||||
|
if self.boolvar_disable_download.get(): return 2
|
||||||
|
|
||||||
dl = requests.get(root+file, allow_redirects=True, stream=True)
|
dl = requests.get(root+file, allow_redirects=True, stream=True)
|
||||||
if os.path.exists(file):
|
if os.path.exists(file):
|
||||||
if int(dl.headers['Content-Length']) == os.path.getsize(file):
|
if int(dl.headers['Content-Length']) == os.path.getsize(file):
|
||||||
|
|
|
@ -105,7 +105,7 @@ def install_mod(self):
|
||||||
|
|
||||||
shutil.rmtree(self.path_mkwf + "/tmp/")
|
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)
|
self.Progress(statut=self.translate("Conversion en")+f" {outputformat}", add=1)
|
||||||
|
|
||||||
if outputformat in ["ISO", "WBFS", "CISO"]:
|
if outputformat in ["ISO", "WBFS", "CISO"]:
|
||||||
|
|
|
@ -24,8 +24,7 @@ def patch_file(self):
|
||||||
self.patch_autoadd()
|
self.patch_autoadd()
|
||||||
self.patch_track(tracks, total_track)
|
self.patch_track(tracks, total_track)
|
||||||
|
|
||||||
self.button_install_mod.grid(row=2, column=1, sticky="NEWS")
|
self.button_install_mod.grid(row=2, column=1, columnspan=2, sticky="NEWS")
|
||||||
self.listbox_outputformat.grid(row=2, column=2, sticky="NEWS")
|
|
||||||
|
|
||||||
except: self.log_error()
|
except: self.log_error()
|
||||||
finally: self.Progress(show=False)
|
finally: self.Progress(show=False)
|
||||||
|
|
|
@ -29,7 +29,7 @@ def patch_autoadd(self):
|
||||||
|
|
||||||
|
|
||||||
def patch_track(self, tracks, total_track="?"):
|
def patch_track(self, tracks, total_track="?"):
|
||||||
max_process = 8
|
max_process = self.intvar_process_track.get()
|
||||||
process_list = {}
|
process_list = {}
|
||||||
error_count, error_max = 0, 3
|
error_count, error_max = 0, 3
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ def patch_track(self, tracks, total_track="?"):
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if len(process_list) < max_process:
|
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" +
|
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)
|
"\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) + ")")
|
str(error_count) + "/" + str(error_max) + ")")
|
||||||
|
|
||||||
if not (os.path.exists(track_szs_file)):
|
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",
|
"./tools/szs/wszst", "NORMALIZE", track_wu8_file, "--DEST",
|
||||||
"./file/Track/%N.szs", "--szs", "--overwrite", "--autoadd-path",
|
"./file/Track/%N.szs", "--szs", "--overwrite", "--autoadd-path",
|
||||||
"./file/auto-add/"], creationflags=CREATE_NO_WINDOW, stderr=subprocess.PIPE)
|
"./file/auto-add/"], creationflags=CREATE_NO_WINDOW, stderr=subprocess.PIPE)
|
||||||
break
|
break
|
||||||
else:
|
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:
|
if process_list[process] is not None:
|
||||||
returncode = process_list[process].poll()
|
returncode = process_list[process].poll()
|
||||||
if returncode is None:
|
if returncode is None:
|
||||||
|
@ -98,6 +98,7 @@ def patch_track(self, tracks, total_track="?"):
|
||||||
break
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
if self.boolvar_del_track_after_conv.get(): os.remove(track_wu8_file)
|
||||||
process_list.pop(process)
|
process_list.pop(process)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue