Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.contentrules.handlers.DuplicateRuleFilter Class Reference

List of all members.

Public Member Functions

def __init__
def reset
def __call__

Public Attributes

 executed
 in_progress

Detailed Description

A filter which can prevent rules from being executed more than once
regardless of context.

Definition at line 16 of file handlers.py.


Constructor & Destructor Documentation

Definition at line 21 of file handlers.py.

00021 
00022     def __init__(self):
00023         self.reset()

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def plone.app.contentrules.handlers.DuplicateRuleFilter.__call__ (   self,
  context,
  rule,
  event 
)

Definition at line 28 of file handlers.py.

00028 
00029     def __call__(self, context, rule, event):
00030         obj = context
00031         if IObjectEvent.providedBy(event):
00032             obj = event.object
00033         
00034         uid_method = getattr(obj, 'UID', None)
00035         if uid_method is not None:
00036             uid = uid_method()
00037         else:
00038             uid = '/'.join(context.getPhysicalPath())
00039         if (uid, rule.__name__,) in self.executed:
00040             return False
00041         else:
00042             self.executed.add((uid, rule.__name__,))
00043             return True
00044 
# A thread local for keeping track of rule execution across events

Here is the caller graph for this function:

Definition at line 24 of file handlers.py.

00024 
00025     def reset(self):
00026         self.executed = set()
00027         self.in_progress = False

Here is the caller graph for this function:


Member Data Documentation

Definition at line 25 of file handlers.py.

Definition at line 26 of file handlers.py.


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