@@ -90,7 +90,7 @@ def is_executable_script(path):
9090 # L'option UI a priorité sur la config ARK
9191 compile_only_main = (
9292 self .opt_main_only .isChecked ()
93- if hasattr (self , "opt_main_only" )
93+ if hasattr (self , "opt_main_only" ) and self . opt_main_only is not None
9494 else compile_only_main_ark
9595 )
9696
@@ -132,63 +132,111 @@ def is_executable_script(path):
132132
133133 # Vérifier s'il y a des fichiers à compiler
134134 if not files_ok :
135- self .log .append (
136- f"❌ Aucun fichier exécutable à compiler.\n "
137- f" Raisons possibles :\n "
138- f" • Aucun fichier Python sélectionné ou dans le workspace\n "
139- f" • Les fichiers n'ont pas de point d'entrée (if __name__ == '__main__')\n "
140- f" • Les fichiers sont dans site-packages ou correspondent à des patterns d'exclusion\n "
141- f" • Les fichiers n'existent pas ou ne sont pas accessibles\n "
142- )
143- self .set_controls_enabled (True )
144- if hasattr (self , "compiler_tabs" ) and self .compiler_tabs :
145- self .compiler_tabs .setEnabled (True )
135+ try :
136+ self .log .append (
137+ f"❌ Aucun fichier exécutable à compiler.\n "
138+ f" Raisons possibles :\n "
139+ f" • Aucun fichier Python sélectionné ou dans le workspace\n "
140+ f" • Les fichiers n'ont pas de point d'entrée (if __name__ == '__main__')\n "
141+ f" • Les fichiers sont dans site-packages ou correspondent à des patterns d'exclusion\n "
142+ f" • Les fichiers n'existent pas ou ne sont pas accessibles\n "
143+ )
144+ except Exception :
145+ pass
146+ try :
147+ self .set_controls_enabled (True )
148+ except Exception :
149+ pass
150+ try :
151+ if hasattr (self , "compiler_tabs" ) and self .compiler_tabs :
152+ self .compiler_tabs .setEnabled (True )
153+ except Exception :
154+ pass
146155 return
147156
148- self .current_compiling .clear ()
149- self .processes .clear ()
150- self .progress .setRange (0 , 0 ) # Mode indéterminé pendant toute la compilation
157+ try :
158+ self .current_compiling .clear ()
159+ except Exception :
160+ pass
161+ try :
162+ self .processes .clear ()
163+ except Exception :
164+ pass
165+ try :
166+ self .progress .setRange (0 , 0 ) # Mode indéterminé pendant toute la compilation
167+ except Exception :
168+ pass
151169
152170 # Afficher les informations de configuration ARK
153171 if ark_config :
154- self .log .append ("📋 Configuration ARK chargée depuis ARK_Main_Config.yml\n " )
172+ try :
173+ self .log .append ("📋 Configuration ARK chargée depuis ARK_Main_Config.yml\n " )
174+ except Exception :
175+ pass
155176 # Afficher les paramètres de compilation utilisés
177+ try :
178+ self .log .append (
179+ f" • Patterns d'inclusion : { ', ' .join (inclusion_patterns )} \n "
180+ )
181+ except Exception :
182+ pass
183+ try :
184+ self .log .append (
185+ f" • Patterns d'exclusion : { len (exclusion_patterns )} pattern(s)\n "
186+ )
187+ except Exception :
188+ pass
189+ try :
190+ self .log .append (
191+ f" • Détection point d'entrée : { 'Activée' if auto_detect_entry_points else 'Désactivée' } \n "
192+ )
193+ except Exception :
194+ pass
195+ try :
196+ self .log .append (
197+ f" • Compiler uniquement main : { 'Oui' if compile_only_main else 'Non' } \n "
198+ )
199+ except Exception :
200+ pass
201+
202+ try :
156203 self .log .append (
157- f" • Patterns d'inclusion : { ', ' .join (inclusion_patterns )} \n "
158- )
159- self .log .append (
160- f" • Patterns d'exclusion : { len (exclusion_patterns )} pattern(s)\n "
161- )
162- self .log .append (
163- f" • Détection point d'entrée : { 'Activée' if auto_detect_entry_points else 'Désactivée' } \n "
164- )
165- self .log .append (
166- f" • Compiler uniquement main : { 'Oui' if compile_only_main else 'Non' } \n "
204+ f"🔨 Compilation parallèle démarrée ({ len (files_ok )} fichier(s))...\n "
167205 )
206+ except Exception :
207+ pass
168208
169- self .log .append (
170- f"🔨 Compilation parallèle démarrée ({ len (files_ok )} fichier(s))...\n "
171- )
172-
173- self .set_controls_enabled (False )
174- self .try_start_processes ()
209+ try :
210+ self .set_controls_enabled (False )
211+ except Exception :
212+ pass
213+ try :
214+ self .try_start_processes ()
215+ except Exception :
216+ pass
175217
176218
177219def compile_all (self ):
178220 import os
179221
180222 # Garde-fous avant toute opération
181223 if self .processes :
182- QMessageBox .warning (
183- self ,
184- self .tr ("Attention" , "Warning" ),
185- self .tr (
186- "Des compilations sont déjà en cours." , "Builds are already running."
187- ),
188- )
224+ try :
225+ QMessageBox .warning (
226+ self ,
227+ self .tr ("Attention" , "Warning" ),
228+ self .tr (
229+ "Des compilations sont déjà en cours." , "Builds are already running."
230+ ),
231+ )
232+ except Exception :
233+ pass
189234 return
190235 if not self .workspace_dir or (not self .python_files and not self .selected_files ):
191- self .log .append ("❌ Aucun fichier à compiler.\n " )
236+ try :
237+ self .log .append ("❌ Aucun fichier à compiler.\n " )
238+ except Exception :
239+ pass
192240 return
193241
194242 # Réinitialise les statistiques de compilation pour ce run
@@ -235,7 +283,26 @@ def _after_bcasl(_report):
235283 self .log .append ("⏭️ Démarrage compilation après BCASL.\n " )
236284 except Exception :
237285 pass
238- _continue_compile_all (self )
286+ try :
287+ _continue_compile_all (self )
288+ except Exception as _e :
289+ try :
290+ import traceback as _tb
291+ self .log .append (
292+ f"⚠️ Exception dans _continue_compile_all: { _e } \n { _tb .format_exc ()} \n "
293+ )
294+ except Exception :
295+ pass
296+ # Réactiver l'UI en cas d'erreur
297+ try :
298+ self .set_controls_enabled (True )
299+ except Exception :
300+ pass
301+ try :
302+ if hasattr (self , "compiler_tabs" ) and self .compiler_tabs :
303+ self .compiler_tabs .setEnabled (True )
304+ except Exception :
305+ pass
239306 except Exception as _e :
240307 try :
241308 import traceback as _tb
@@ -245,6 +312,16 @@ def _after_bcasl(_report):
245312 )
246313 except Exception :
247314 pass
315+ # Réactiver l'UI en cas d'erreur
316+ try :
317+ self .set_controls_enabled (True )
318+ except Exception :
319+ pass
320+ try :
321+ if hasattr (self , "compiler_tabs" ) and self .compiler_tabs :
322+ self .compiler_tabs .setEnabled (True )
323+ except Exception :
324+ pass
248325
249326 _run_bcasl_async (self , _after_bcasl )
250327 return # différer la suite dans le callback pour ne pas bloquer
0 commit comments