The Gaudi Framework  v39r2 (37c0b60a)
GaudiTesting.preprocessors.RegexpReplacer Class Reference
Inheritance diagram for GaudiTesting.preprocessors.RegexpReplacer:
Collaboration diagram for GaudiTesting.preprocessors.RegexpReplacer:

Public Member Functions

def __init__ (self, orig, repl="", when=None)
 
def __add__ (self, rhs)
 
def __processLine__ (self, line)
 
- Public Member Functions inherited from GaudiTesting.preprocessors.FilePreprocessor
def __processFile__ (self, lines)
 
def __call__ (self, input)
 

Private Attributes

 _operations
 

Detailed Description

Definition at line 93 of file preprocessors.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 94 of file preprocessors.py.

94  def __init__(self, orig, repl="", when=None):
95  if when:
96  when = re.compile(when)
97  self._operations = [(when, re.compile(orig), repl)]
98 

Member Function Documentation

◆ __add__()

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

Reimplemented from GaudiTesting.preprocessors.FilePreprocessor.

Definition at line 99 of file preprocessors.py.

99  def __add__(self, rhs):
100  if isinstance(rhs, RegexpReplacer):
101  res = RegexpReplacer("", "", None)
102  res._operations = self._operations + rhs._operations
103  else:
104  res = FilePreprocessor.__add__(self, rhs)
105  return res
106 

◆ __processLine__()

def GaudiTesting.preprocessors.RegexpReplacer.__processLine__ (   self,
  line 
)

Reimplemented from GaudiTesting.preprocessors.FilePreprocessor.

Definition at line 107 of file preprocessors.py.

107  def __processLine__(self, line):
108  for w, o, r in self._operations:
109  if w is None or w.search(line):
110  line = o.sub(r, line)
111  return line
112 
113 
114 # Common preprocessors

Member Data Documentation

◆ _operations

GaudiTesting.preprocessors.RegexpReplacer._operations
private

Definition at line 97 of file preprocessors.py.


The documentation for this class was generated from the following file:
GaudiTesting.preprocessors.__processLine__
__processLine__
Definition: preprocessors.py:121