From 3d703932ca887d449d45be3867feb73f22e3b37b Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Thu, 20 May 2021 13:06:14 +0200 Subject: [PATCH] fixed some problem with new subprocess.call, causing some file to go inside the wrong directory some error with bmg file could appear if files already existed wu8 file were converted to bz instead of szs --- main.pyw | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.pyw b/main.pyw index 821f0d1..e67012f 100644 --- a/main.pyw +++ b/main.pyw @@ -66,15 +66,16 @@ class ClassApp(): def patch_file(self): with open("./convert_file.json") as f: fc = json.load(f) for file in fc["img"]: + print(get_filename(file)) if not(os.path.exists("./file/"+get_filename(file))): subprocess.call(["wimgt", "ENCODE", "./file/"+file, "-x", fc["img"][file]]) for file in fc["bmg"]: - if not(os.path.exists("./file/"+get_filename(file))): + if not(os.path.exists("./file/"+get_filename(file)+".bmg")): subprocess.call(["wbmgt", "ENCODE", "./file/"+file]) - subprocess.call(["wszst", "NORMALIZE", "./file/Track-WU8/*.wu8", "-d", "./file/Track/", "--szs", "--overwrite", - "--autoadd-path", self.path_mkwf+"/files/Race/Course/"]) + subprocess.call(["wszst", "NORMALIZE", "./file/Track-WU8/*.wu8", "-d", "./file/Track/%N.szs", "--szs", + "--overwrite", "--autoadd-path", self.path_mkwf+"/files/Race/Course/"]) def install_mod(self): @@ -112,7 +113,7 @@ class ClassApp(): print(extracted_file) for file in extracted_file: - subprocess.call(["wszst", "CREATE", file+".d", "-d", "file", "--overwrite"]) + subprocess.call(["wszst", "CREATE", file+".d", "-d", file, "--overwrite"]) if os.path.exists(file+".d"): shutil.rmtree(file+".d") subprocess.call(["wstrt", "patch", self.path_mkwf+"/sys/main.dol", "--clean-dol", "--add-lecode"])