1
2 """Run a non-solver utility"""
3
4 from AnalyzedRunner import AnalyzedRunner
5 from PyFoam.LogAnalysis.UtilityAnalyzer import UtilityAnalyzer
6
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):
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
39 """get a list of all the IDs"""
40 return self.analyzer.getIDs(name)
41
43 """get a list of all the times that are available for ID"""
44 return self.analyzer.getTimes(name,ID=ID)
45