#NEWLINE# def start( self ) : #NEWLINE# #INDENT# def _worker( ) : #NEWLINE# #INDENT# while ( not self . stop ) : #NEWLINE# #INDENT# task = self . worker_queue . get ( ) #NEWLINE# try : #NEWLINE# #INDENT# run_task ( self . ctx , task ) #NEWLINE# #UNINDENT# except yaku . errors . TaskRunFailure : #NEWLINE# #INDENT# e = get_exception ( ) #NEWLINE# self . failure_lock . acquire ( ) #NEWLINE# self . stop = True #NEWLINE# self . failure_lock . release ( ) #NEWLINE# task . error_msg = e . explain #NEWLINE# task . error_cmd = e . cmd #NEWLINE# self . error_out . put ( task ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# e = get_exception ( ) #NEWLINE# ( exc_type , exc_value , tb ) = sys . exc_info ( ) #NEWLINE# lines = traceback . format_exception ( exc_type , exc_value , tb ) #NEWLINE# self . failure_lock . acquire ( ) #NEWLINE# self . stop = True #NEWLINE# self . failure_lock . release ( ) #NEWLINE# task . error_msg = '' . join ( lines ) #NEWLINE# task . error_cmd = [ ] #NEWLINE# self . error_out . put ( task ) #NEWLINE# #UNINDENT# self . worker_queue . task_done ( ) #NEWLINE# #UNINDENT# #UNINDENT# for i in range ( self . njobs ) : #NEWLINE# #INDENT# t = threading . Thread ( target = _worker ) #NEWLINE# t . setDaemon ( True ) #NEWLINE# t . start ( )