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

Source Code for Module PyFoam.Execution.AnalyzedRunner

 1  #  ICE Revision: $Id: AnalyzedRunner.py 8292 2007-12-12 15:22:00Z 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,argv=None,silent=False,logname="PyFoamSolve",server=False,lam=None,restart=False):
13 """ @param analyzer: the analyzer for the output 14 argv, silent, logname, server, lam - see BasicRunner""" 15 BasicRunner.__init__(self,argv,silent,logname,server=server,lam=lam,restart=restart) 16 AnalyzedCommon.__init__(self,logname,analyzer)
17
18 - def lineHandle(self,line):
19 """Not to be called: calls the analyzer for the current line""" 20 AnalyzedCommon.lineHandle(self,line) 21 BasicRunner.lineHandle(self,line)
22
23 - def lastTime(self):
24 return self.getTime()
25
26 - def firstCpuTime(self):
27 exe=self.getAnalyzer("Execution") 28 if exe==None: 29 return None 30 else: 31 return exe.timeFirst()
32
33 - def firstClockTime(self):
34 exe=self.getAnalyzer("Execution") 35 if exe==None: 36 return None 37 else: 38 return exe.clockFirst()
39
40 - def totalCpuTime(self):
41 exe=self.getAnalyzer("Execution") 42 if exe==None: 43 return None 44 else: 45 return exe.timeTotal()
46
47 - def totalClockTime(self):
48 exe=self.getAnalyzer("Execution") 49 if exe==None: 50 return None 51 else: 52 return exe.clockTotal()
53
54 - def stopHandle(self):
55 BasicRunner.stopHandle(self) 56 self.tearDown()
57