The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
GaudiTesting.preprocessors.SortGroupOfLines Class Reference
Inheritance diagram for GaudiTesting.preprocessors.SortGroupOfLines:
Collaboration diagram for GaudiTesting.preprocessors.SortGroupOfLines:

Public Member Functions

 __init__ (self, exp)
 __processFile__ (self, lines)
Public Member Functions inherited from GaudiTesting.preprocessors.FilePreprocessor
 __processLine__ (self, line)
 __processFile__ (self, lines)
 __call__ (self, input)
 __add__ (self, rhs)

Public Attributes

 exp = exp if hasattr(exp, "match") else re.compile(exp)

Detailed Description

Sort group of lines matching a regular expression

Definition at line 146 of file preprocessors.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiTesting.preprocessors.SortGroupOfLines.__init__ ( self,
exp )

Definition at line 151 of file preprocessors.py.

151 def __init__(self, exp):
152 self.exp = exp if hasattr(exp, "match") else re.compile(exp)
153

Member Function Documentation

◆ __processFile__()

GaudiTesting.preprocessors.SortGroupOfLines.__processFile__ ( self,
lines )

Definition at line 154 of file preprocessors.py.

154 def __processFile__(self, lines):
155 match = self.exp.match
156 output = []
157 group = []
158 for l in lines:
159 if match(l):
160 group.append(l)
161 else:
162 if group:
163 group.sort()
164 output.extend(group)
165 group = []
166 output.append(l)
167 return output
168
169
170# Preprocessors for GaudiTestSuite

Member Data Documentation

◆ exp

GaudiTesting.preprocessors.SortGroupOfLines.exp = exp if hasattr(exp, "match") else re.compile(exp)

Definition at line 152 of file preprocessors.py.


The documentation for this class was generated from the following file: