The Gaudi Framework  v32r2 (46d42edc)
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 517 of file GaudiTest.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 518 of file GaudiTest.py.

518  def __init__(self, orig, repl="", when=None):
519  if when:
520  when = re.compile(when)
521  self._operations = [(when, re.compile(orig), repl)]
522 

Member Function Documentation

◆ __add__()

def GaudiTest.RegexpReplacer.__add__ (   self,
  rhs 
)

Reimplemented from GaudiTest.FilePreprocessor.

Definition at line 523 of file GaudiTest.py.

523  def __add__(self, rhs):
524  if isinstance(rhs, RegexpReplacer):
525  res = RegexpReplacer("", "", None)
526  res._operations = self._operations + rhs._operations
527  else:
528  res = FilePreprocessor.__add__(self, rhs)
529  return res
530 

◆ __processLine__()

def GaudiTest.RegexpReplacer.__processLine__ (   self,
  line 
)

Reimplemented from GaudiTest.FilePreprocessor.

Definition at line 531 of file GaudiTest.py.

531  def __processLine__(self, line):
532  for w, o, r in self._operations:
533  if w is None or w.search(line):
534  line = o.sub(r, line)
535  return line
536 
537 
538 # Common preprocessors

Member Data Documentation

◆ _operations

GaudiTest.RegexpReplacer._operations
private

Definition at line 521 of file GaudiTest.py.


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