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

Source Code for Module PyFoam.Execution.UtilityRunner

 1  #  ICE Revision: $Id: UtilityRunner.py 9667 2008-11-12 18:20:16Z 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, 17 argv=None, 18 silent=False, 19 logname="PyFoamUtility", 20 server=False, 21 restart=False, 22 noLog=False):
23 """see BasicRunner""" 24 AnalyzedRunner.__init__(self,UtilityAnalyzer(), 25 argv=argv, 26 silent=silent, 27 logname=logname, 28 server=server, 29 restart=restart, 30 noLog=noLog)
31
32 - def add(self,name,exp,idNr=None):
33 """adds a regular expression 34 35 name - name under whcih the RegExp is known 36 exp - the regular expression 37 idNr - number of the pattern group that is used to make a data 38 set unique""" 39 self.analyzer.addExpression(name,exp,idNr) 40 self.reset()
41
42 - def get(self,name,time=None,ID=None):
43 """get a data set 44 45 name - name of the RegExp 46 time - at which time (if unset the last time is used) 47 ID - the unique ID determined by idNr""" 48 return self.analyzer.getData(name,time=time,ID=ID)
49
50 - def getIDs(self,name):
51 """get a list of all the IDs""" 52 return self.analyzer.getIDs(name)
53
54 - def getTimes(self,name,ID=None):
55 """get a list of all the times that are available for ID""" 56 return self.analyzer.getTimes(name,ID=ID)
57