Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
wicked.fieldevent.txtfilter.TxtFilter Class Reference
Inheritance diagram for wicked.fieldevent.txtfilter.TxtFilter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def findall
def patterns
def chunks
def dynamic
def filtered_chunks
def filtered_text
def __call__

Public Attributes

 context
 field
 event

Static Public Attributes

 name = None
 pattern = None

Private Member Functions

def _filterCore

Detailed Description

Abstract Base for Filtration

Definition at line 33 of file txtfilter.py.


Constructor & Destructor Documentation

def wicked.fieldevent.txtfilter.TxtFilter.__init__ (   self,
  field,
  context,
  event 
)

Reimplemented in wicked.txtfilter.WickedFilter.

Definition at line 41 of file txtfilter.py.

00041 
00042     def __init__(self, field, context, event):
00043         self.context = context
00044         self.field = field
00045         self.event = event

Here is the caller graph for this function:


Member Function Documentation

Reimplemented in wicked.txtfilter.WickedFilter.

Definition at line 83 of file txtfilter.py.

00083 
00084     def __call__(self):
00085         if len(self.chunks) == 1: # fastpath
00086             return 
00087 
00088         # set value reference (accessing filtered_text does the work)
00089         self.event.value = self.filtered_text

Here is the call graph for this function:

Here is the caller graph for this function:

def wicked.fieldevent.txtfilter.TxtFilter._filterCore (   self,
  chunk,
  kwargs 
) [private]
Subclasses override this to provide specific impls

Reimplemented in wicked.txtfilter.WickedFilter.

Definition at line 90 of file txtfilter.py.

00090 
00091     def _filterCore(self,  chunk, **kwargs):
00092         """Subclasses override this to provide specific impls"""
00093         return ''
00094 

Here is the caller graph for this function:

Simple text replacement via co-op with the modules

Definition at line 61 of file txtfilter.py.

00061 
00062     def chunks(self):
00063         """Simple text replacement via co-op with the modules"""
00064         for pattern in self.patterns:
00065             val=pattern.split(self.event.value)
00066             if len(val)>1:
00067                 return val
00068         return val

Here is the call graph for this function:

Here is the caller graph for this function:

tricky ben saller split

Definition at line 70 of file txtfilter.py.

00070 
00071     def dynamic(self):
00072         """tricky ben saller split"""
00073         return self.chunks[1::2]

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 75 of file txtfilter.py.

00075 
00076     def filtered_chunks(self):
00077         return [self._filterCore(d, **self.event.kwargs) for d in self.dynamic]

Here is the call graph for this function:

Here is the caller graph for this function:

join the two lists (knowing that len(text) == subs+1)

Reimplemented in wicked.txtfilter.WickedFilter.

Definition at line 79 of file txtfilter.py.

00079 
00080     def filtered_text(self):
00081         """join the two lists (knowing that len(text) == subs+1)"""
00082         return ''.join(ijoin(self.chunks[::2], self.filtered_chunks))
    

Here is the call graph for this function:

Here is the caller graph for this function:

def wicked.fieldevent.txtfilter.TxtFilter.findall (   self,
  value 
)

Definition at line 47 of file txtfilter.py.

00047 
00048     def findall(self, value):
00049         for pattern in self.patterns:
00050             val = pattern.findall(value)
00051             if len(val):
00052                 return val
00053         return val
        

Here is the call graph for this function:

Definition at line 55 of file txtfilter.py.

00055 
00056     def patterns(self):
00057         if not isinstance(self.pattern, list):
00058             return [self.pattern]
00059         return self.pattern

Here is the caller graph for this function:


Member Data Documentation

Definition at line 42 of file txtfilter.py.

Definition at line 44 of file txtfilter.py.

Definition at line 43 of file txtfilter.py.

Reimplemented in wicked.txtfilter.WickedFilter.

Definition at line 38 of file txtfilter.py.

Reimplemented in wicked.txtfilter.BrackettedWickedFilter, and wicked.txtfilter.WickedFilter.

Definition at line 39 of file txtfilter.py.


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