The Gaudi Framework  v31r0 (aeb156f0)
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 __processLine__ (self, line)
 
def __call__ (self, input)
 
def __add__ (self, rhs)
 

Private Attributes

 _operations
 

Detailed Description

Definition at line 516 of file GaudiTest.py.

Constructor & Destructor Documentation

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

Definition at line 517 of file GaudiTest.py.

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

Member Function Documentation

def GaudiTest.RegexpReplacer.__add__ (   self,
  rhs 
)

Definition at line 522 of file GaudiTest.py.

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

Definition at line 530 of file GaudiTest.py.

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

Member Data Documentation

GaudiTest.RegexpReplacer._operations
private

Definition at line 520 of file GaudiTest.py.


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