def job_complete(node, verbose=False):
 if ((node.PollPath is None) or node.istip()):
  raise JobError(('Attempting to merge tip: %s' % node.Name))
 if node.Processed:
  raise JobError(('Already processed node: %s' % node.Name))
 if os.path.exists(node.PollPath):
  node.EndTime = time()
  node.TotalTime = (node.EndTime - node.StartTime)
  node.ExitStatus = open(node.PollPath).read().strip()
  if (node.ExitStatus != '0'):
   raise JobError(('Node %s did not complete correctly!' % node.Name))
  if verbose:
   print ('finishing %s, %f seconds' % (node.Name, node.TotalTime))
  node.Processed = True
  return True
 else:
  return False

def job_complete ( node , verbose = False ) : if ( ( node . PollPath is None ) or node . istip ( ) ) : raise JobError ( ( 'Attempting to merge tip: %s' % node . Name ) ) if node . Processed : raise JobError ( ( 'Already processed node: %s' % node . Name ) ) if os . path . exists ( node . PollPath ) : node . EndTime = time ( ) node . TotalTime = ( node . EndTime - node . StartTime ) node . ExitStatus = open ( node . PollPath ) . read ( ) . strip ( ) if ( node . ExitStatus != '0' ) : raise JobError ( ( 'Node %s did not complete correctly!' % node . Name ) ) if verbose : print ( 'finishing %s, %f seconds' % ( node . Name , node . TotalTime ) ) node . Processed = True return True else : return False
check if the job is complete .