The Gaudi Framework  v33r0 (d5ea422b)
GaudiTest.RegexpReplacer Class Reference
Inheritance diagram for GaudiTest.RegexpReplacer:
Collaboration diagram for GaudiTest.RegexpReplacer:

Public Member Functions

def __init__ (self, orig, repl="", when=None)
 
def __add__ (self, rhs)
 
def __processLine__ (self, line)
 
- Public Member Functions inherited from GaudiTest.FilePreprocessor
def __call__ (self, input)
 

Private Attributes

 _operations
 

Detailed Description

Definition at line 527 of file GaudiTest.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiTest.RegexpReplacer.__init__ (   self,
  orig,
  repl = "",
  when = None 
)

Definition at line 528 of file GaudiTest.py.

528  def __init__(self, orig, repl="", when=None):
529  if when:
530  when = re.compile(when)
531  self._operations = [(when, re.compile(orig), repl)]
532 

Member Function Documentation

◆ __add__()

def GaudiTest.RegexpReplacer.__add__ (   self,
  rhs 
)

Reimplemented from GaudiTest.FilePreprocessor.

Definition at line 533 of file GaudiTest.py.

533  def __add__(self, rhs):
534  if isinstance(rhs, RegexpReplacer):
535  res = RegexpReplacer("", "", None)
536  res._operations = self._operations + rhs._operations
537  else:
538  res = FilePreprocessor.__add__(self, rhs)
539  return res
540 

◆ __processLine__()

def GaudiTest.RegexpReplacer.__processLine__ (   self,
  line 
)

Reimplemented from GaudiTest.FilePreprocessor.

Definition at line 541 of file GaudiTest.py.

541  def __processLine__(self, line):
542  for w, o, r in self._operations:
543  if w is None or w.search(line):
544  line = o.sub(r, line)
545  return line
546 
547 
548 # Common preprocessors

Member Data Documentation

◆ _operations

GaudiTest.RegexpReplacer._operations
private

Definition at line 531 of file GaudiTest.py.


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