Skip to content

Commit 8dce0cf

Browse files
committed
Refactor: centralisation de l'ouverture du dossier de sortie dans le core runner (ARK gère le succès par défaut)
1 parent a651e58 commit 8dce0cf

4 files changed

Lines changed: 9 additions & 16 deletions

File tree

Core/Compiler/engine_runner.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,16 @@ def _read_stream(stream, callback):
430430
stdout_thread.join()
431431
stderr_thread.join()
432432

433-
# Call on_success hook if compilation succeeded
433+
# Compilation success hooks
434434
if process.returncode == 0:
435+
# 1. ARK opens the output directory by default
436+
try:
437+
if hasattr(engine_instance, "open_output_dir"):
438+
engine_instance.open_output_dir(context.output_dir)
439+
except Exception:
440+
pass
441+
442+
# 2. Call engine-specific on_success hook
435443
try:
436444
if hasattr(engine_instance, "on_success"):
437445
engine_instance.on_success(bridge, str(entry_path))

engines/cx_freeze/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def preflight(self, gui, file: str) -> bool:
6666

6767
def build_command(self, context: BuildContext) -> list[str]:
6868
"""Build a cx_Freeze command line from a normalized build context."""
69-
self._last_context = context
7069
cfg = getattr(self, "_config_overrides", {})
7170
if not isinstance(cfg, dict):
7271
cfg = {}
@@ -150,10 +149,6 @@ def on_success(self, gui, file: str) -> None:
150149
"success",
151150
"Compilation CX_Freeze terminée avec succès.",
152151
)
153-
154-
# Open output directory automatically
155-
if hasattr(self, "_last_context") and self._last_context:
156-
self.open_output_dir(self._last_context.output_dir)
157152
except Exception:
158153
pass
159154

engines/nuitka/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def preflight(self, gui, file: str) -> bool:
7171

7272
def build_command(self, context: BuildContext) -> list[str]:
7373
"""Build a Nuitka command line from a normalized build context."""
74-
self._last_context = context
7574
cfg = getattr(self, "_config_overrides", {})
7675
if not isinstance(cfg, dict):
7776
cfg = {}
@@ -173,10 +172,6 @@ def on_success(self, gui, file: str) -> None:
173172
"success",
174173
"Compilation Nuitka terminée avec succès.",
175174
)
176-
177-
# Open output directory automatically
178-
if hasattr(self, "_last_context") and self._last_context:
179-
self.open_output_dir(self._last_context.output_dir)
180175
except Exception:
181176
pass
182177

engines/pyinstaller/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def preflight(self, gui, file: str) -> bool:
6666

6767
def build_command(self, context: BuildContext) -> list[str]:
6868
"""Build a PyInstaller command line from a normalized build context."""
69-
self._last_context = context
7069
cfg = getattr(self, "_config_overrides", {})
7170
if not isinstance(cfg, dict):
7271
cfg = {}
@@ -155,10 +154,6 @@ def on_success(self, gui, file: str) -> None:
155154
"success",
156155
"Compilation PyInstaller terminée avec succès.",
157156
)
158-
159-
# Open output directory automatically
160-
if hasattr(self, "_last_context") and self._last_context:
161-
self.open_output_dir(self._last_context.output_dir)
162157
except Exception:
163158
pass
164159

0 commit comments

Comments
 (0)