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

Source Code for Module PyFoam.Execution.UtilityRunner

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