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

Source Code for Module PyFoam.Execution.UtilityRunner

 1  #  ICE Revision: $Id: UtilityRunner.py 7858 2007-09-03 09:47:29Z bgschaid $  
 2  """Run a non-solver utility""" 
 3   
 4  from AnalyzedRunner import AnalyzedRunner 
 5  from PyFoam.LogAnalysis.UtilityAnalyzer import UtilityAnalyzer 
 6   
7 -class UtilityRunner(AnalyzedRunner):
8 """To this runner regular expressions can be added. Each line is 9 checked against each regular expression and saved with the 10 corresponding time. 11 12 Each RegEx has a name 13 14 For each pattern group in the RegEx one data value is stored""" 15
16 - def __init__(self,argv=None,silent=False,logname="PyFoamUtility",server=False,restart=False):
17 """see BasicRunner""" 18 AnalyzedRunner.__init__(self,UtilityAnalyzer(),argv=argv,silent=silent,logname=logname,server=server,restart=restart)
19
20 - def add(self,name,exp,idNr=None):
21 """adds a regular expression 22 23 name - name under whcih the RegExp is known 24 exp - the regular expression 25 idNr - number of the pattern group that is used to make a data 26 set unique""" 27 self.analyzer.addExpression(name,exp,idNr) 28 self.reset()
29
30 - def get(self,name,time=None,ID=None):
31 """get a data set 32 33 name - name of the RegExp 34 time - at which time (if unset the last time is used) 35 ID - the unique ID determined by idNr""" 36 return self.analyzer.getData(name,time=time,ID=ID)
37
38 - def getIDs(self,name):
39 """get a list of all the IDs""" 40 return self.analyzer.getIDs(name)
41
42 - def getTimes(self,name,ID=None):
43 """get a list of all the times that are available for ID""" 44 return self.analyzer.getTimes(name,ID=ID)
45