2 from crabWrap
import crabStatus,convertStatus,getOutput
4 from threading
import Thread,Lock,Event
10 def __init__(self, project, action = getOutput):
31 print "Crab retrieve status failed (",failed,
")" 36 print "Relative percentage finished: %.0f%%" % statusNew[
'Finished']
37 print "Relative percentage failed : %.0f%%" % statusNew[
'Failed']
38 print "Relative percentage running : %.0f%%" % statusNew[
'Running']
39 if statusNew[
'Failed'] > 50.0:
raise RuntimeError(
'Too many jobs have failed (%.0f%%).' % statusNew[
'Failed'])
40 if statusNew[
'Finished'] >= self.
threshold:
break 43 if self.finish.isSet(): exit =
True 46 if not exit: time.sleep(180)
52 if __name__ ==
'__main__':
57 if opt[:8] ==
'project=':
60 if not project:
raise ValueError(
'Need to set project')
def __init__(self, project, action=getOutput)
def setThreshold(self, threshold)
def convertStatus(status)