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)
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",
121 normalizeEOL.__processLine__ =
lambda line: str(line).rstrip() +
"\n"
125 skipEmptyLines.__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
171 normalizeTestSuite = 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",
189 "ServiceLocatorHelper::",
190 "ServiceLocatorHelper::(create|locate)Service",
191 "ServiceLocatorHelper::service",
194 (
None,
r"e([-+])0([0-9][0-9])",
r"e\1\2"),
196 (
None,
r"Service reference count check:",
r"Looping over all active services..."),
200 r"^(.*(DEBUG|SUCCESS) List of ALL properties of .*#properties = )\d+",
203 (
"ApplicationMgr",
r"(declareMultiSvcType|addMultiSvc): ",
""),
204 (
r"Property \['Name': Value\]",
r"( = '[^']+':)'(.*)'",
r"\1\2"),
205 (
"TimelineSvc",
"to file 'TimelineFile':",
"to file "),
206 (
"DataObjectHandleBase",
r'DataObjectHandleBase\("([^"]*)"\)',
r"'\1'"),
213 "JobOptionsSvc INFO # ",
214 "JobOptionsSvc WARNING # ",
217 "This machine has a speed",
219 "ToolSvc.Sequenc... INFO",
220 "DataListenerSvc INFO XML written to file:",
223 "DEBUG No writable file catalog found which contains FID:",
224 "DEBUG Service base class initialized successfully",
226 "DEBUG Incident timing:",
230 "INFO 'CnvServices':[",
232 "DEBUG 'CnvServices':[",
237 "ServiceLocatorHelper::service: found service JobOptionsSvc",
239 "mismatching case for property name:",
241 "Histograms saving not required.",
243 "Properties are dumped into",
245 "WARNING no ROOT output file name",
246 "INFO Writing ROOT histograms to:",
247 "INFO Completed update of ROOT histograms in:",
250 "data dependencies:",
253 r"^JobOptionsSvc INFO *$",
256 r"(Always|SUCCESS)\s*(Root f|[^ ]* F)ile version:",
257 r"File '.*.xml' does not exist",
258 r"INFO Refer to dataset .* by its file ID:",
259 r"INFO Referring to dataset .* by its file ID:",
260 r"INFO Disconnect from dataset",
261 r"INFO Disconnected from dataset",
262 r"INFO Disconnected data IO:",
263 r"IncidentSvc\s*(DEBUG (Adding|Removing)|VERBOSE Calling)",
265 r".*StatusCodeSvc.*",
266 r".*StatusCodeCheck.*",
267 r"Num\s*\|\s*Function\s*\|\s*Source Library",
270 r"ERROR Failed to modify file: .* Errno=2 No such file or directory",
272 r"^ +[0-9]+ \|.*ROOT",
273 r"^ +[0-9]+ \|.*\|.*Dict",
275 r"EventLoopMgr.*---> Loop Finished",
276 r"HiveSlimEventLo.*---> Loop Finished",
281 r"SUCCESS\s*Booked \d+ Histogram\(s\)",
285 r"Property(.*)'Audit(Algorithm|Tool|Service)s':",
286 r"Property(.*)'Audit(Begin|End)Run':",
288 r"Property(.*)'AuditRe(start|initialize)':",
289 r"Property(.*)'Blocking':",
291 r"Property(.*)'ErrorCount(er)?':",
293 r"Property(.*)'Sequential':",
295 r"Property(.*)'FilterCircularDependencies':",
297 r"Property(.*)'IsClonable':",
299 r"Property update for OutputLevel : new value =",
300 r"EventLoopMgr\s*DEBUG Creating OutputStream",
304 normalizeTestSuite = (