#NEWLINE# def __init__( self , execution , parent = None , prev = None ) : #NEWLINE# #INDENT# QtGui . QTreeWidgetItem . __init__ ( self , parent ) #NEWLINE# self . execution = execution #NEWLINE# execution . item = self #NEWLINE# self . modules = [ ] #NEWLINE# self . wf_item = ( prev or self ) #NEWLINE# if isinstance ( execution , WorkflowExec ) : #NEWLINE# #INDENT# for item_exec in execution . item_execs : #NEWLINE# #INDENT# QExecutionItem ( item_exec , self , self ) #NEWLINE# #UNINDENT# if ( execution . completed == ( - 2 ) ) : #NEWLINE# #INDENT# brush = CurrentTheme . SUSPENDED_MODULE_BRUSH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( execution . completed == 1 ) : #NEWLINE# #INDENT# brush = CurrentTheme . SUCCESS_MODULE_BRUSH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# brush = CurrentTheme . ERROR_MODULE_BRUSH #NEWLINE# #UNINDENT# #UNINDENT# if execution . db_name : #NEWLINE# #INDENT# self . setText ( 0 , execution . db_name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . setText ( 0 , ( 'Version #%s' % execution . parent_version ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( execution , ModuleExec ) : #NEWLINE# #INDENT# prev . modules . append ( self ) #NEWLINE# for loop_exec in execution . loop_execs : #NEWLINE# #INDENT# QExecutionItem ( loop_exec , self , prev ) #NEWLINE# #UNINDENT# if ( execution . completed == 1 ) : #NEWLINE# #INDENT# if execution . error : #NEWLINE# #INDENT# brush = CurrentTheme . ERROR_MODULE_BRUSH #NEWLINE# self . wf_item . execution . completed = ( - 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if execution . cached : #NEWLINE# #INDENT# brush = CurrentTheme . NOT_EXECUTED_MODULE_BRUSH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# brush = CurrentTheme . SUCCESS_MODULE_BRUSH #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( execution . completed == ( - 2 ) ) : #NEWLINE# #INDENT# brush = CurrentTheme . SUSPENDED_MODULE_BRUSH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# brush = CurrentTheme . ERROR_MODULE_BRUSH #NEWLINE# #UNINDENT# #UNINDENT# self . setText ( 0 , ( '%s' % execution . module_name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( execution , GroupExec ) : #NEWLINE# #INDENT# prev . modules . append ( self ) #NEWLINE# for item_exec in execution . item_execs : #NEWLINE# #INDENT# if isinstance ( item_exec , LoopExec ) : #NEWLINE# #INDENT# QExecutionItem ( item_exec , self , prev ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# QExecutionItem ( item_exec , self , self ) #NEWLINE# #UNINDENT# #UNINDENT# if ( execution . completed == 1 ) : #NEWLINE# #INDENT# if execution . error : #NEWLINE# #INDENT# self . wf_item . execution . completed = ( - 1 ) #NEWLINE# brush = CurrentTheme . ERROR_MODULE_BRUSH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if execution . cached : #NEWLINE# #INDENT# brush = CurrentTheme . NOT_EXECUTED_MODULE_BRUSH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# brush = CurrentTheme . SUCCESS_MODULE_BRUSH #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( execution . completed == ( - 2 ) ) : #NEWLINE# #INDENT# brush = CurrentTheme . SUSPENDED_MODULE_BRUSH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# brush = CurrentTheme . ERROR_MODULE_BRUSH #NEWLINE# #UNINDENT# #UNINDENT# self . setText ( 0 , 'Group' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( execution , LoopExec ) : #NEWLINE# #INDENT# for iteration in execution . loop_iterations : #NEWLINE# #INDENT# QExecutionItem ( iteration , self , prev ) #NEWLINE# #UNINDENT# brush = CurrentTheme . MODULE_BRUSH #NEWLINE# self . setText ( 0 , 'Loop' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( execution , LoopIteration ) : #NEWLINE# #INDENT# for item_exec in execution . item_execs : #NEWLINE# #INDENT# QExecutionItem ( item_exec , self , prev ) #NEWLINE# #UNINDENT# if ( execution . completed == 1 ) : #NEWLINE# #INDENT# if execution . error : #NEWLINE# #INDENT# self . wf_item . execution . completed = ( - 1 ) #NEWLINE# brush = CurrentTheme . ERROR_MODULE_BRUSH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# brush = CurrentTheme . SUCCESS_MODULE_BRUSH #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( execution . completed == ( - 2 ) ) : #NEWLINE# #INDENT# brush = CurrentTheme . SUSPENDED_MODULE_BRUSH #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# brush = CurrentTheme . ERROR_MODULE_BRUSH #NEWLINE# #UNINDENT# #UNINDENT# self . setText ( 0 , ( 'Iteration #%s' % execution . iteration ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# self . setText ( 1 , execution . ts_start . strftime ( '%H:%M %d/%m' ) . replace ( ' 0' , ' ' ) . replace ( '/0' , '/' ) ) #NEWLINE# self . setData ( 1 , QtCore . Qt . UserRole , str ( execution . ts_start ) ) #NEWLINE# pixmap = QtGui . QPixmap ( 10 , 10 ) #NEWLINE# pixmap . fill ( brush . color ( ) ) #NEWLINE# icon = QtGui . QIcon ( pixmap ) #NEWLINE# self . setIcon ( 0 , icon )