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 464 of file GaudiTest.py.

Constructor & Destructor Documentation

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

Definition at line 465 of file GaudiTest.py.

465  def __init__(self, orig, repl = "", when = None):
466  if when:
467  when = re.compile(when)
468  self._operations = [ (when, re.compile(orig), repl) ]
def __init__(self, orig, repl="", when=None)
Definition: GaudiTest.py:465

Member Function Documentation

def GaudiTest.RegexpReplacer.__add__ (   self,
  rhs 
)

Definition at line 469 of file GaudiTest.py.

469  def __add__(self,rhs):
470  if isinstance(rhs, RegexpReplacer):
471  res = RegexpReplacer("","",None)
472  res._operations = self._operations + rhs._operations
473  else:
474  res = FilePreprocessor.__add__(self, rhs)
475  return res
def __add__(self, rhs)
Definition: GaudiTest.py:469
def GaudiTest.RegexpReplacer.__processLine__ (   self,
  line 
)

Definition at line 476 of file GaudiTest.py.

476  def __processLine__(self, line):
477  for w,o,r in self._operations:
478  if w is None or w.search(line):
479  line = o.sub(r, line)
480  return line
481 
482 # Common preprocessors
def __processLine__(self, line)
Definition: GaudiTest.py:476

Member Data Documentation

GaudiTest.RegexpReplacer._operations
private

Definition at line 468 of file GaudiTest.py.


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