@@ -92,17 +92,15 @@ def build_command(self, context: BuildContext) -> list[str]:
9292 if windowed_enabled and platform .system () in {"Windows" , "Darwin" }:
9393 cmd .append ("--windowed" )
9494
95- output_dir = str (context .output_dir or cfg . get ( "output_dir" ) or "" ).strip ()
95+ output_dir = str (context .output_dir or "" ).strip ()
9696 if output_dir :
9797 cmd .extend (["--distpath" , output_dir ])
9898
99- icon_path = str (context .icon or cfg .get ("selected_icon" ) or "" ).strip ()
100- if not icon_path and hasattr (self , "_selected_icon" ) and self ._selected_icon :
101- icon_path = str (self ._selected_icon ).strip ()
99+ icon_path = str (context .icon or "" ).strip ()
102100 if icon_path :
103101 cmd .extend (["--icon" , icon_path ])
104102
105- output_name = str (cfg . get ( "target_name" ) or context .project_name or "" ).strip ()
103+ output_name = str (context .project_name or "" ).strip ()
106104 if output_name :
107105 cmd .extend (["--name" , output_name ])
108106
@@ -150,24 +148,12 @@ def environment(self) -> Optional[dict[str, str]]:
150148 def on_success (self , gui , file : str ) -> None :
151149 """Handle successful compilation."""
152150 try :
153- # Log success message with output location
154- output_dir = (
155- getattr (
156- self , "_output_dir_input" , getattr (gui , "output_dir_input" , None )
151+ if hasattr (gui , "log" ):
152+ log_with_level (
153+ gui ,
154+ "success" ,
155+ "Compilation PyInstaller terminée avec succès." ,
157156 )
158- if hasattr (self , "_gui" )
159- else getattr (self , "_output_dir_input" , None )
160- )
161- if output_dir and output_dir .text ().strip ():
162- try :
163- if hasattr (gui , "log" ):
164- log_with_level (
165- gui ,
166- "success" ,
167- f"Sortie générée dans: { output_dir .text ().strip ()} " ,
168- )
169- except Exception :
170- pass
171157 except Exception :
172158 pass
173159
0 commit comments