@@ -729,7 +729,7 @@ def load_results(self, filename):
729729
730730 def start_macro (
731731 self , macrolist = None , folderlist = None , search_subdirs = None , logfile = None
732- ):
732+ ) -> AnyPyProcessOutputList :
733733 """Start a batch processing job.
734734
735735 Runs a list of AnyBody Macro commands in
@@ -838,29 +838,27 @@ def start_macro(
838838 raise ValueError ("Nothing to process for " + str (macrolist ))
839839
840840 # Start the scheduler
841- try :
842- with Progress (
843- TextColumn ("{task.description}" ),
844- BarColumn (),
845- "{task.completed}/{task.total}" ,
846- TimeElapsedColumn (),
847- TimeRemainingColumn (),
848- disable = self .silent ,
849- ) as progress :
850- task_progress = progress .add_task (
851- "Processing tasks" , total = len (tasklist )
852- )
841+ with Progress (
842+ TextColumn ("{task.description}" ),
843+ BarColumn (),
844+ "{task.completed}/{task.total}" ,
845+ TimeElapsedColumn (),
846+ TimeRemainingColumn (),
847+ disable = self .silent ,
848+ ) as progress :
849+ task_progress = progress .add_task ("Processing tasks" , total = len (tasklist ))
850+ try :
853851 for task in self ._schedule_processes (tasklist ):
854852 if task .has_error () and not self .silent :
855853 progress_print (progress , task_summery (task ))
856854 progress .update (task_progress , style = "red" , refresh = True )
857855 progress .update (task_progress , advance = 1 , refresh = True )
858- except KeyboardInterrupt :
859- print ( "[red]KeyboardInterrupt: User aborted[/red]" )
860- finally :
861- _subprocess_container .stop_all ()
862- if not self .silent :
863- print ( tasklist_summery (tasklist ))
856+ except KeyboardInterrupt :
857+ progress_print ( progress , "[red]KeyboardInterrupt: User aborted[/red]" )
858+ finally :
859+ _subprocess_container .stop_all ()
860+ if not self .silent :
861+ progress_print ( progress , tasklist_summery (tasklist ))
864862
865863 self .cleanup_logfiles (tasklist )
866864 # Cache the processed tasklist for restarting later
0 commit comments