if a DATA dir is found when extracting ROM, it will add it to self.path_mkwf

This commit is contained in:
raphael60650 2021-06-15 20:34:25 +02:00
parent e243c5fdfd
commit fc049d0178

View file

@ -66,13 +66,14 @@ def __init__(self):
"Êtes-vous sûr de vouloir l'utiliser ?")): "Êtes-vous sûr de vouloir l'utiliser ?")):
self.path_mkwf = os.path.realpath(path + "/../../") self.path_mkwf = os.path.realpath(path + "/../../")
elif extension.upper() in ["ISO", "WBFS", "WIA", "CSIO"]: elif extension.upper() in ["ISO", "WBFS", "WIA", "CSIO"]:
# Fiding a directory name that dosen't already exist
directory_name, i = "MKWiiFaraphel", 1 directory_name, i = "MKWiiFaraphel", 1
while True: while True:
self.path_mkwf = os.path.realpath(path + f"/../{directory_name}") self.path_mkwf = os.path.realpath(path + f"/../{directory_name}")
if not(os.path.exists(self.path_mkwf)): break if not(os.path.exists(self.path_mkwf)): break
directory_name, i = f"MKWiiFaraphel ({i})", i + 1 directory_name, i = f"MKWiiFaraphel ({i})", i + 1
if os.path.exists(self.path_mkwf + "/DATA/"): self.path_mkwf += "/DATA/"
self.Progress(show=True, indeter=True, statut=self.translate("Extraction du jeu...")) self.Progress(show=True, indeter=True, statut=self.translate("Extraction du jeu..."))
subprocess.call(["./tools/wit/wit", "EXTRACT", get_nodir(path), "--DEST", directory_name] subprocess.call(["./tools/wit/wit", "EXTRACT", get_nodir(path), "--DEST", directory_name]