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,
17 argv=None,
18 silent=False,
19 logname="PyFoamUtility",
20 server=False,
21 restart=False,
22 noLog=False):
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
51 """get a list of all the IDs"""
52 return self.analyzer.getIDs(name)
53
55 """get a list of all the times that are available for ID"""
56 return self.analyzer.getTimes(name,ID=ID)
57