GaudiTesting.BaseTest.RegexpReplacer Class Reference
Inheritance diagram for GaudiTesting.BaseTest.RegexpReplacer:
Collaboration diagram for GaudiTesting.BaseTest.RegexpReplacer:

Public Member Functions

def __init__
 
def __add__ (self, rhs)
 
def __processLine__ (self, line)
 
def __init__
 
def __add__ (self, rhs)
 
def __processLine__ (self, line)
 
- Public Member Functions inherited from GaudiTesting.BaseTest.FilePreprocessor
def __processLine__ (self, line)
 
def __call__ (self, input)
 
def __add__ (self, rhs)
 
def __processLine__ (self, line)
 
def __call__ (self, input)
 
def __add__ (self, rhs)
 

Private Attributes

 _operations
 

Detailed Description

Definition at line 692 of file BaseTest.py.

Constructor & Destructor Documentation

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

Definition at line 693 of file BaseTest.py.

693  def __init__(self, orig, repl = "", when = None):
694  if when:
695  when = re.compile(when)
696  self._operations = [ (when, re.compile(orig), repl) ]
def GaudiTesting.BaseTest.RegexpReplacer.__init__ (   self,
  orig,
  repl = "",
  when = None 
)

Definition at line 693 of file BaseTest.py.

693  def __init__(self, orig, repl = "", when = None):
694  if when:
695  when = re.compile(when)
696  self._operations = [ (when, re.compile(orig), repl) ]

Member Function Documentation

def GaudiTesting.BaseTest.RegexpReplacer.__add__ (   self,
  rhs 
)

Definition at line 697 of file BaseTest.py.

697  def __add__(self,rhs):
698  if isinstance(rhs, RegexpReplacer):
699  res = RegexpReplacer("","",None)
700  res._operations = self._operations + rhs._operations
701  else:
702  res = FilePreprocessor.__add__(self, rhs)
703  return res
def GaudiTesting.BaseTest.RegexpReplacer.__add__ (   self,
  rhs 
)

Definition at line 697 of file BaseTest.py.

697  def __add__(self,rhs):
698  if isinstance(rhs, RegexpReplacer):
699  res = RegexpReplacer("","",None)
700  res._operations = self._operations + rhs._operations
701  else:
702  res = FilePreprocessor.__add__(self, rhs)
703  return res
def GaudiTesting.BaseTest.RegexpReplacer.__processLine__ (   self,
  line 
)

Definition at line 704 of file BaseTest.py.

704  def __processLine__(self, line):
705  for w,o,r in self._operations:
706  if w is None or w.search(line):
707  line = o.sub(r, line)
708  return line
709 
710 # Common preprocessors
def GaudiTesting.BaseTest.RegexpReplacer.__processLine__ (   self,
  line 
)

Definition at line 704 of file BaseTest.py.

704  def __processLine__(self, line):
705  for w,o,r in self._operations:
706  if w is None or w.search(line):
707  line = o.sub(r, line)
708  return line
709 
710 # Common preprocessors

Member Data Documentation

GaudiTesting.BaseTest.RegexpReplacer._operations
private

Definition at line 696 of file BaseTest.py.


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