The Gaudi Framework  v30r3 (a5ef0a68)
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 504 of file GaudiTest.py.

Constructor & Destructor Documentation

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

Definition at line 505 of file GaudiTest.py.

505  def __init__(self, orig, repl="", when=None):
506  if when:
507  when = re.compile(when)
508  self._operations = [(when, re.compile(orig), repl)]
509 
def __init__(self, orig, repl="", when=None)
Definition: GaudiTest.py:505

Member Function Documentation

def GaudiTest.RegexpReplacer.__add__ (   self,
  rhs 
)

Definition at line 510 of file GaudiTest.py.

510  def __add__(self, rhs):
511  if isinstance(rhs, RegexpReplacer):
512  res = RegexpReplacer("", "", None)
513  res._operations = self._operations + rhs._operations
514  else:
515  res = FilePreprocessor.__add__(self, rhs)
516  return res
517 
def __add__(self, rhs)
Definition: GaudiTest.py:510
def GaudiTest.RegexpReplacer.__processLine__ (   self,
  line 
)

Definition at line 518 of file GaudiTest.py.

518  def __processLine__(self, line):
519  for w, o, r in self._operations:
520  if w is None or w.search(line):
521  line = o.sub(r, line)
522  return line
523 
524 
525 # Common preprocessors
def __processLine__(self, line)
Definition: GaudiTest.py:518

Member Data Documentation

GaudiTest.RegexpReplacer._operations
private

Definition at line 508 of file GaudiTest.py.


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