[Zope3-checkins] CVS: Zope3/src/zope/app/observable - observerevent.py:1.1

Nathan Yergler nathan at yergler.net
Tue Mar 30 16:47:39 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/observable
In directory cvs.zope.org:/tmp/cvs-serv8162/src/zope/app/observable

Added Files:
	observerevent.py 
Log Message:


Moved ObserverEvent event channel out of zope.app.event into zope.app.observable.




=== Added File Zope3/src/zope/app/observable/observerevent.py ===
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Event channel class for observable events.

$Id: observerevent.py,v 1.1 2004/03/30 21:47:38 nathan Exp $
"""

from zope.app.event.interfaces import ISubscriber
from zope.app.observable.interfaces import IObservable
from zope.interface import implements

class ObserverEventNotifier:

    implements(ISubscriber)

    def notify (self, event):
        adapter = IObservable(event.object, None)

        if adapter is not None:
            adapter.notify(event, ISubscriber)

observerEventNotifierInstance = ObserverEventNotifier()





More information about the Zope3-Checkins mailing list