The Gaudi Framework  v32r1 (f65d50dc)
GaudiTest.FilePreprocessor Class Reference
Inheritance diagram for GaudiTest.FilePreprocessor:

Public Member Functions

def __processLine__ (self, line)
 
def __call__ (self, input)
 
def __add__ (self, rhs)
 

Detailed Description

Base class for a callable that takes a file and returns a modified
version of it.

Definition at line 442 of file GaudiTest.py.

Member Function Documentation

◆ __add__()

def GaudiTest.FilePreprocessor.__add__ (   self,
  rhs 
)

Reimplemented in GaudiTest.RegexpReplacer, and GaudiTest.FilePreprocessorSequence.

Definition at line 465 of file GaudiTest.py.

465  def __add__(self, rhs):
466  return FilePreprocessorSequence([self, rhs])
467 
468 

◆ __call__()

def GaudiTest.FilePreprocessor.__call__ (   self,
  input 
)

Reimplemented in GaudiTest.FilePreprocessorSequence.

Definition at line 449 of file GaudiTest.py.

449  def __call__(self, input):
450  if hasattr(input, "__iter__"):
451  lines = input
452  mergeback = False
453  else:
454  lines = input.splitlines()
455  mergeback = True
456  output = []
457  for l in lines:
458  l = self.__processLine__(l)
459  if l:
460  output.append(l)
461  if mergeback:
462  output = '\n'.join(output)
463  return output
464 

◆ __processLine__()

def GaudiTest.FilePreprocessor.__processLine__ (   self,
  line 
)

Reimplemented in GaudiTest.LineSorter, GaudiTest.RegexpReplacer, GaudiTest.BlockSkipper, and GaudiTest.LineSkipper.

Definition at line 446 of file GaudiTest.py.

446  def __processLine__(self, line):
447  return line
448 

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