#NEWLINE# def _sync_step_from_active( self , step ) : #NEWLINE# #INDENT# item = self . _get_jenkins_job ( step ) #NEWLINE# if ( not step . data . get ( 'uri' ) ) : #NEWLINE# #INDENT# step . data [ 'uri' ] = item [ 'url' ] #NEWLINE# #UNINDENT# node = self . _get_node ( step . data [ 'master' ] , item [ 'builtOn' ] ) #NEWLINE# step . node = node #NEWLINE# step . date_started = datetime . utcfromtimestamp ( ( item [ 'timestamp' ] / 1000 ) ) #NEWLINE# if item [ 'building' ] : #NEWLINE# #INDENT# step . status = Status . in_progress #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# step . status = Status . finished #NEWLINE# step . result = RESULT_MAP [ item [ 'result' ] ] #NEWLINE# step . date_finished = datetime . utcfromtimestamp ( ( ( item [ 'timestamp' ] + item [ 'duration' ] ) / 1000 ) ) #NEWLINE# #UNINDENT# if ( step . status == Status . finished ) : #NEWLINE# #INDENT# self . _sync_results ( step , item ) #NEWLINE# #UNINDENT# if db . session . is_modified ( step ) : #NEWLINE# #INDENT# db . session . add ( step ) #NEWLINE# db . session . commit ( )