work in progress: rule handling
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2151 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
890152bbd3
commit
985fcef56d
2 changed files with 4 additions and 1 deletions
|
@ -57,12 +57,14 @@ class RuleManager(object):
|
|||
return self.rules.get(event.name, [])
|
||||
|
||||
def handleEvent(self, event):
|
||||
result = []
|
||||
rules = self.getRulesForEvent(event)
|
||||
for r in rules:
|
||||
ri = IRuleInstance(event.context)
|
||||
ri.template = r
|
||||
ri.event = event
|
||||
ri.applyTemplate()
|
||||
result.append(ri.applyTemplate())
|
||||
return result
|
||||
|
||||
|
||||
class Rule(Template):
|
||||
|
|
|
@ -47,4 +47,5 @@ class RuleInstance(Instance):
|
|||
handler = component.getAdapter(self, IActionHandler,
|
||||
name=action.handlerName)
|
||||
data = handler(data, action.parameters)
|
||||
return data
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue