All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
SerialSubstitution.RegExDeleteLineClass Class Reference
Inheritance diagram for SerialSubstitution.RegExDeleteLineClass:
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

 regex
 
 exceptions
 
- Public Attributes inherited from SerialSubstitution.SubstitutionClass
 options
 

Detailed Description

Definition at line 104 of file SerialSubstitution.py.

Constructor & Destructor Documentation

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

Definition at line 105 of file SerialSubstitution.py.

106  def __init__(self, match, exceptions = []):
107  SubstitutionClass.__init__(self)
108  self.regex = re.compile(match)
self.exceptions = list(map(re.compile, exceptions))
list
Definition: file_to_url.sh:28

Member Function Documentation

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

Definition at line 113 of file SerialSubstitution.py.

114  def __call__(self, s, context = None):
115  for pattern in self.exceptions:
116  if pattern.search(s) is not None: return s
117  if self.regex.match(s): return []
return s
def SerialSubstitution.RegExDeleteLineClass.__str__ (   self)

Definition at line 111 of file SerialSubstitution.py.

112  def __str__(self): return self.regex.pattern
def SerialSubstitution.RegExDeleteLineClass.Describe (   self)

Definition at line 120 of file SerialSubstitution.py.

121  def Describe(self):
122  return "%r (remove)" % (self.regex.pattern, )
123 
124 # class RegExDeleteLineClass
125 

Member Data Documentation

SerialSubstitution.RegExDeleteLineClass.exceptions

Definition at line 108 of file SerialSubstitution.py.

SerialSubstitution.RegExDeleteLineClass.regex

Definition at line 107 of file SerialSubstitution.py.


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