All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
SerialSubstitution.ReplacementClass Class Reference
Inheritance diagram for SerialSubstitution.ReplacementClass:
SerialSubstitution.SubstitutionClass

Public Member Functions

def __init__
 
def __str__
 
def __call__
 
def Describe
 
- Public Member Functions inherited from SerialSubstitution.SubstitutionClass
def __init__
 
def SetOptions
 
def __str__
 
def __call__
 
def describe
 

Public Attributes

 pattern
 
 repl
 
 exceptions
 
- Public Attributes inherited from SerialSubstitution.SubstitutionClass
 options
 

Detailed Description

Definition at line 126 of file SerialSubstitution.py.

Constructor & Destructor Documentation

def SerialSubstitution.ReplacementClass.__init__ (   self,
  match,
  replacement,
  exceptions = [] 
)

Definition at line 127 of file SerialSubstitution.py.

128  def __init__(self, match, replacement, exceptions = []):
129  SubstitutionClass.__init__(self)
130  self.pattern = match
131  self.repl = replacement
self.exceptions = exceptions

Member Function Documentation

def SerialSubstitution.ReplacementClass.__call__ (   self,
  s,
  context = None 
)

Definition at line 136 of file SerialSubstitution.py.

137  def __call__(self, s, context = None):
138  for pattern in self.exceptions:
139  if pattern in s: return s
return s.replace(self.pattern, self.repl)
def SerialSubstitution.ReplacementClass.__str__ (   self)

Definition at line 134 of file SerialSubstitution.py.

135  def __str__(self): return self.pattern
def SerialSubstitution.ReplacementClass.Describe (   self)

Definition at line 142 of file SerialSubstitution.py.

143  def Describe(self):
144  return "%r -> %r (literal)" % (self.pattern, self.repl)
145 
146 # class ReplacementClass
147 

Member Data Documentation

SerialSubstitution.ReplacementClass.exceptions

Definition at line 131 of file SerialSubstitution.py.

SerialSubstitution.ReplacementClass.pattern

Definition at line 129 of file SerialSubstitution.py.

SerialSubstitution.ReplacementClass.repl

Definition at line 130 of file SerialSubstitution.py.


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