The Gaudi Framework  master (594c33fa)
GaudiTesting.BaseTest.SortGroupOfLines Class Reference
Inheritance diagram for GaudiTesting.BaseTest.SortGroupOfLines:
Collaboration diagram for GaudiTesting.BaseTest.SortGroupOfLines:

Public Member Functions

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

Public Attributes

 exp
 

Detailed Description

Sort group of lines matching a regular expression

Definition at line 1038 of file BaseTest.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiTesting.BaseTest.SortGroupOfLines.__init__ (   self,
  exp 
)

Definition at line 1043 of file BaseTest.py.

1043  def __init__(self, exp):
1044  self.exp = exp if hasattr(exp, "match") else re.compile(exp)
1045 

Member Function Documentation

◆ __processFile__()

def GaudiTesting.BaseTest.SortGroupOfLines.__processFile__ (   self,
  lines 
)

Reimplemented from GaudiTesting.BaseTest.FilePreprocessor.

Definition at line 1046 of file BaseTest.py.

1046  def __processFile__(self, lines):
1047  match = self.exp.match
1048  output = []
1049  group = []
1050  for l in lines:
1051  if match(l):
1052  group.append(l)
1053  else:
1054  if group:
1055  group.sort()
1056  output.extend(group)
1057  group = []
1058  output.append(l)
1059  return output
1060 
1061 
1062 # Preprocessors for GaudiTestSuite

Member Data Documentation

◆ exp

GaudiTesting.BaseTest.SortGroupOfLines.exp

Definition at line 1044 of file BaseTest.py.


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