Inherits threading::Thread.
Public Member Functions | |
def | __init__ |
def | run |
def | setThreshold |
Public Attributes | |
action | |
finish | |
lock | |
project | |
threshold |
Definition at line 6 of file CrabWatch.py.
def CrabWatch::CrabWatch::__init__ | ( | self, | |
project, | |||
action = getOutput |
|||
) |
Definition at line 10 of file CrabWatch.py.
def CrabWatch::CrabWatch::run | ( | self | ) |
Definition at line 22 of file CrabWatch.py.
00023 : 00024 exit = False 00025 while not exit: 00026 #if checkStatus(self.project,80.0): break 00027 status = crabStatus(self.project) 00028 statusNew = convertStatus(status) 00029 print "Relative percentage finished: %.0f%%" % statusNew['Finished'] 00030 print "Relative percentage failed : %.0f%%" % statusNew['Failed'] 00031 print "Relative percentage running : %.0f%%" % statusNew['Running'] 00032 if statusNew['Failed'] > 50.0: raise RuntimeError,'Too many jobs have failed (%.0f%%).' % statusNew['Failed'] 00033 if statusNew['Finished'] >= self.threshold: break 00034 00035 self.lock.acquire() 00036 if self.finish.isSet(): exit = True 00037 self.lock.release() 00038 00039 if not exit: time.sleep(180) 00040 00041 print "Finished..." 00042 00043 if self.action: self.action(self.project)
def CrabWatch::CrabWatch::setThreshold | ( | self, | |
threshold | |||
) |
Definition at line 19 of file CrabWatch.py.
Definition at line 10 of file CrabWatch.py.
Definition at line 10 of file CrabWatch.py.
Definition at line 10 of file CrabWatch.py.
Definition at line 10 of file CrabWatch.py.
Definition at line 10 of file CrabWatch.py.