The Gaudi Framework  master (1304469f)
Loading...
Searching...
No Matches
GaudiTesting.preprocessors.RegexpReplacer Class Reference
Inheritance diagram for GaudiTesting.preprocessors.RegexpReplacer:
Collaboration diagram for GaudiTesting.preprocessors.RegexpReplacer:

Public Member Functions

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

Protected Attributes

list _operations = [(when, re.compile(orig), repl)]
 

Detailed Description

Definition at line 93 of file preprocessors.py.

Constructor & Destructor Documentation

◆ __init__()

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__()

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

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__()

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

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

list GaudiTesting.preprocessors.RegexpReplacer._operations = [(when, re.compile(orig), repl)]
protected

Definition at line 97 of file preprocessors.py.


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