Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | Static Private Attributes
PortalTransforms.libtransforms.retransform.retransform Class Reference

List of all members.

Public Member Functions

def __init__
def name
def addRegex
def convert

Public Attributes

 regexes

Static Public Attributes

tuple inputs = ('text/',)

Private Attributes

 __name__

Static Private Attributes

 __implements__ = itransform

Detailed Description

abstract class for regex transforms (re.sub wrapper)

Definition at line 4 of file retransform.py.


Constructor & Destructor Documentation

Definition at line 10 of file retransform.py.

00010 
00011     def __init__(self, name, *args):
00012         self.__name__ = name
00013         self.regexes = []
00014         for pat, repl in args:
00015             self.addRegex(pat, repl)


Member Function Documentation

Definition at line 19 of file retransform.py.

00019 
00020     def addRegex(self, pat, repl):
00021         r = re.compile(pat)
00022         self.regexes.append((r, repl))

def PortalTransforms.libtransforms.retransform.retransform.convert (   self,
  orig,
  data,
  kwargs 
)

Definition at line 23 of file retransform.py.

00023 
00024     def convert(self, orig, data, **kwargs):
00025         for r, repl in self.regexes:
00026             orig = r.sub(repl, orig)
00027         data.setData(orig)
00028         return data

Here is the caller graph for this function:

Definition at line 16 of file retransform.py.

00016 
00017     def name(self):
00018         return self.__name__

Here is the caller graph for this function:


Member Data Documentation

Definition at line 6 of file retransform.py.

Definition at line 11 of file retransform.py.

Definition at line 8 of file retransform.py.

Definition at line 12 of file retransform.py.


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