[Zope3-checkins] CVS: Zope3/src/zope/app/event -
configure.zcml:1.8.2.1 objectevent.py:1.12.2.1
Nathan Yergler
nathan at yergler.net
Tue Mar 23 16:35:10 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/event
In directory cvs.zope.org:/tmp/cvs-serv15170/app/event
Modified Files:
Tag: observable-branch
configure.zcml objectevent.py
Log Message:
Added ObserverEventNotifier for dispatching instance based event notifications.
=== Zope3/src/zope/app/event/configure.zcml 1.8 => 1.8.2.1 ===
--- Zope3/src/zope/app/event/configure.zcml:1.8 Thu Mar 11 03:14:02 2004
+++ Zope3/src/zope/app/event/configure.zcml Tue Mar 23 16:35:10 2004
@@ -28,6 +28,9 @@
subscriber=".objectevent.objectEventNotifierInstance"
event_types="zope.app.event.interfaces.IObjectEvent" />
+<event:subscribe
+ subscriber=".objectevent.observerEventNotifierInstance"
+ event_types="zope.app.event.interfaces.IObjectEvent" />
<!-- Local Event Service -->
<content class=".localservice.EventService">
=== Zope3/src/zope/app/event/objectevent.py 1.12 => 1.12.2.1 ===
--- Zope3/src/zope/app/event/objectevent.py:1.12 Mon Mar 15 15:41:42 2004
+++ Zope3/src/zope/app/event/objectevent.py Tue Mar 23 16:35:10 2004
@@ -85,6 +85,17 @@
objectEventNotifierInstance = ObjectEventNotifier()
+class ObserverEventNotifier:
+
+ implements(ISubscriber)
+
+ def notify (self, event):
+ adapter = IObservable(event.object, None)
+
+ if adapter is not None:
+ adapter.notify(event, ISubscriber)
+
+observerEventNotifierInstance = ObserverEventNotifier()
def objectEventCallbackHelper(callback):
"""Build a factory implementing ISubscriber that just calls a callback
More information about the Zope3-Checkins
mailing list