Package PyFoam :: Package Execution :: Module AnalyzedRunner
[hide private]
[frames] | no frames]

Source Code for Module PyFoam.Execution.AnalyzedRunner

 1  #  ICE Revision: $Id: AnalyzedRunner.py 10900 2009-09-28 13:04:35Z bgschaid $  
 2  """Command is run and output is analyzed""" 
 3   
 4  from BasicRunner import BasicRunner 
 5  from AnalyzedCommon import AnalyzedCommon 
 6   
7 -class AnalyzedRunner(AnalyzedCommon,BasicRunner):
8 """The output of a command is analyzed while being run 9 10 Side effects (files written etc) depend on the analyzer""" 11
12 - def __init__(self,analyzer, 13 argv=None, 14 silent=False, 15 logname="PyFoamSolve", 16 server=False, 17 lam=None, 18 compressLog=False, 19 restart=False, 20 noLog=False, 21 remark=None, 22 jobId=None):
23 """ @param analyzer: the analyzer for the output 24 argv, silent, logname, server, lam, noLog - see BasicRunner""" 25 BasicRunner.__init__(self,argv,silent,logname, 26 server=server, 27 lam=lam, 28 restart=restart, 29 compressLog=compressLog, 30 noLog=noLog, 31 remark=remark, 32 jobId=jobId) 33 AnalyzedCommon.__init__(self,logname,analyzer)
34
35 - def lineHandle(self,line):
36 """Not to be called: calls the analyzer for the current line""" 37 AnalyzedCommon.lineHandle(self,line) 38 BasicRunner.lineHandle(self,line)
39
40 - def lastTime(self):
41 return self.getTime()
42
43 - def firstCpuTime(self):
44 exe=self.getAnalyzer("Execution") 45 if exe==None: 46 return None 47 else: 48 return exe.timeFirst()
49
50 - def firstClockTime(self):
51 exe=self.getAnalyzer("Execution") 52 if exe==None: 53 return None 54 else: 55 return exe.clockFirst()
56
57 - def totalCpuTime(self):
58 exe=self.getAnalyzer("Execution") 59 if exe==None: 60 return None 61 else: 62 return exe.timeTotal()
63
64 - def totalClockTime(self):
65 exe=self.getAnalyzer("Execution") 66 if exe==None: 67 return None 68 else: 69 return exe.clockTotal()
70
71 - def stopHandle(self):
72 BasicRunner.stopHandle(self) 73 self.tearDown()
74