From fc049d01783cfcc9b51a0632f0d6df6c17b4b7c9 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Tue, 15 Jun 2021 20:34:25 +0200 Subject: [PATCH] if a DATA dir is found when extracting ROM, it will add it to self.path_mkwf --- source/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/__init__.py b/source/__init__.py index b821af8..73b96eb 100644 --- a/source/__init__.py +++ b/source/__init__.py @@ -66,13 +66,14 @@ def __init__(self): "Êtes-vous sûr de vouloir l'utiliser ?")): self.path_mkwf = os.path.realpath(path + "/../../") elif extension.upper() in ["ISO", "WBFS", "WIA", "CSIO"]: + # Fiding a directory name that dosen't already exist directory_name, i = "MKWiiFaraphel", 1 - while True: self.path_mkwf = os.path.realpath(path + f"/../{directory_name}") if not(os.path.exists(self.path_mkwf)): break 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...")) subprocess.call(["./tools/wit/wit", "EXTRACT", get_nodir(path), "--DEST", directory_name]