[Zope3-checkins] CVS: Zope3/src/zope/app/tentative - event.py:1.1.2.1

Nathan Yergler nathan at yergler.net
Thu Apr 1 08:18:54 EST 2004


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

Added Files:
      Tag: tentative-branch
	event.py 
Log Message:


Initial checkin of tentative event work; 
implemented stubs of event wrappers.




=== Added File Zope3/src/zope/app/tentative/event.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.
#
##############################################################################
"""Tentative event wrappers and event channel.

$Id: event.py,v 1.1.2.1 2004/04/01 13:18:54 nathan Exp $
"""

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

class TentativeEvent:
    pass

class ConfirmedEvent:
    pass

class TentativeEventNotifier:

    implements(ISubscriber)

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

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

tentativeEventNotifierInstance = TentativeEventNotifier()





More information about the Zope3-Checkins mailing list