15 """Base class for a callable that takes a file and returns a modified
30 if not isinstance(input, str):
34 lines = input.splitlines()
38 output =
"\n".join(output)
64 self.
regexps = list(map(re.compile, regexps))
83 if self.
start in line:
86 elif self.
end in line:
96 when = re.compile(when)
100 if isinstance(rhs, RegexpReplacer):
102 res._operations = self.
_operations + rhs._operations
104 res = FilePreprocessor.__add__(self, rhs)
109 if w
is None or w.search(line):
110 line = o.sub(r, line)
117 "[0-2]?[0-9]:[0-5][0-9]:[0-5][0-9] [0-9]{4}[-/][01][0-9][-/][0-3][0-9][ A-Z]*",
118 "00:00:00 1970-01-01",
121normalizeEOL.__processLine__ =
lambda line: str(line).rstrip() +
"\n"
125skipEmptyLines.__processLine__ =
lambda line: (line.strip()
and line)
or None
139 line = line[: (pos + self.
siglen)]
140 lst = line[(pos + self.
siglen) :].split()
142 line +=
" ".join(lst)
148 Sort group of lines matching a regular expression
152 self.
exp = exp
if hasattr(exp,
"match")
else re.compile(exp)
155 match = self.
exp.match
171normalizeTestSuite = maskPointers + normalizeDate
173 (
"TIMER",
r"\s+[+-]?[0-9]+[0-9.e+-]*",
" 0"),
174 (
"release all pending",
r"^.*/([^/]*:.*)",
r"\1"),
175 (
"^#.*file",
r"file '.*[/\\]([^/\\]*)$",
r"file '\1"),
177 "^JobOptionsSvc.*options successfully read in from",
178 r"read in from .*[/\\]([^/\\]*)$",
184 r"[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}(?!-0{12})-[0-9A-Fa-f]{12}",
185 "00000000-0000-0000-0000-000000000000",
190 r"^(.*(DEBUG|SUCCESS) List of ALL properties of .*#properties = )\d+",
193 (
r"Property \['Name': Value\]",
r"( = '[^']+':)'(.*)'",
r"\1\2"),
194 (
"TimelineSvc",
"to file 'TimelineFile':",
"to file "),
195 (
"DataObjectHandleBase",
r'DataObjectHandleBase\("([^"]*)"\)',
r"'\1'"),
206 "DEBUG No writable file catalog found which contains FID:",
207 "DEBUG Service base class initialized successfully",
209 "DEBUG Incident timing:",
211 "DEBUG 'CnvServices':[",
216 "mismatching case for property name:",
218 "Properties are dumped into",
220 "WARNING no ROOT output file name",
221 "INFO Writing ROOT histograms to:",
222 "INFO Completed update of ROOT histograms in:",
223 "INFO Disconnect from dataset",
224 "INFO Disconnected from dataset",
225 "INFO Disconnected data IO:",
228 "data dependencies:",
232 r"^JobOptionsSvc\s+INFO # ",
233 r"^JobOptionsSvc\s+WARNING # ",
234 r"^JobOptionsSvc\s+INFO *$",
237 r"(Always|SUCCESS)\s*(Root f|[^ ]* F)ile version:",
238 r"File '.*.xml' does not exist",
239 r"INFO Referring to dataset .* by its file ID:",
240 r"IncidentSvc\s*(DEBUG (Adding|Removing)|VERBOSE Calling)",
244 r"EventLoopMgr.*---> Loop Finished",
245 r"HiveSlimEventLo.*---> Loop Finished",
249 r"SUCCESS\s*Booked \d+ Histogram\(s\)",
253 r"Property update for OutputLevel : new value =",
257normalizeTestSuite = (
__init__(self, start, end)
__processFile__(self, lines)
__processLine__(self, line)
__init__(self, members=[])
__init__(self, strings=[], regexps=[])
__init__(self, signature)
__init__(self, orig, repl="", when=None)
__processFile__(self, lines)