[Zope3-Users] fine grained subscriber

2007-03-28 Thread Lorenzo Gil Sanchez
Hi, I'm writing an event subscriber to the IIntIdRemoveEvent event type. It looks like this: def intIdRemovedSubscriber(event): if IMyInterface.providedBy(event.object): # do some stuff with event.object and the zcml: subscriber handler=.intIdRemovedSubscriber

Re: [Zope3-Users] fine grained subscriber

2007-03-28 Thread FB
Hi, On Wed, Mar 28, 2007 at 12:16:23PM +0200, Lorenzo Gil Sanchez wrote: [snip] But I'd like to avoid the if clause inside my subscriber function by doing something similar to this: def intIdRemovedSubscriber(obj, event): # do some stuff with obj, which is garanteed to provide

Re: [Zope3-Users] fine grained subscriber

2007-03-28 Thread Lorenzo Gil Sanchez
El mié, 28-03-2007 a las 12:50 +0200, FB escribió: You need a dispatcher - a quite common concept in zope3: [events.py, not tested] from zope.event import notify def removeIntId(event): notify(event.object,event) I think the notify call should be like notify((event.object,

Re: [Zope3-Users] fine grained subscriber

2007-03-28 Thread Lorenzo Gil Sanchez
El mié, 28-03-2007 a las 13:39 +0200, Lorenzo Gil Sanchez escribió: El mié, 28-03-2007 a las 12:50 +0200, FB escribió: You need a dispatcher - a quite common concept in zope3: [events.py, not tested] from zope.event import notify def removeIntId(event):