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

Source Code for Module PyFoam.Execution.UtilityRunner

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