[Zope3-checkins] CVS: Zope3/src/zope/app/event - objectevent.py:1.5
Steve Alexander
steve@cat-box.net
Sat, 7 Jun 2003 02:36:53 -0400
Update of /cvs-repository/Zope3/src/zope/app/event
In directory cvs.zope.org:/tmp/cvs-serv4008/src/zope/app/event
Modified Files:
objectevent.py
Log Message:
Changed to use new-style implements declarations.
There's a problem here.
IObjectMovedEvent should extend both IObjectAddedEvent and
IObjectRemovedEvent. Similarly, IObjectCopiedEvent should extend
IObjectAddedEvent.
This is described in
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/RenameMoveCopy
This is not the case, and it needs fixing.
=== Zope3/src/zope/app/event/objectevent.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/event/objectevent.py:1.4 Wed Mar 19 14:57:27 2003
+++ Zope3/src/zope/app/event/objectevent.py Sat Jun 7 02:36:51 2003
@@ -25,13 +25,14 @@
from zope.app.interfaces.event import IObjectAnnotationsModifiedEvent
from zope.app.interfaces.event import IObjectContentModifiedEvent
from zope.app.traversing import getPath
+from zope.interface import implements, implementsOnly
_marker = object()
class ObjectEvent:
"""Something has happened to an object"""
- __implements__ = IObjectEvent
+ implements(IObjectEvent)
def _getLocation(self):
if self.__location is not _marker:
@@ -47,37 +48,38 @@
class ObjectAddedEvent(ObjectEvent):
"""An object has been added to a container"""
- __implements__ = IObjectAddedEvent
+ implements(IObjectAddedEvent)
class ObjectCreatedEvent(ObjectEvent):
"""An object has been created"""
- __implements__ = IObjectCreatedEvent
+ implements(IObjectCreatedEvent)
class ObjectModifiedEvent(ObjectEvent):
"""An object has been modified"""
- __implements__ = IObjectModifiedEvent
+ implements(IObjectModifiedEvent)
class ObjectAnnotationsModifiedEvent(ObjectModifiedEvent):
"""An object's annotations have been modified"""
- __implements__ = IObjectAnnotationsModifiedEvent
+ implements(IObjectAnnotationsModifiedEvent)
class ObjectContentModifiedEvent(ObjectModifiedEvent):
"""An object's content has been modified"""
- __implements__ = IObjectContentModifiedEvent
+ implements(IObjectContentModifiedEvent)
class ObjectRemovedEvent(ObjectEvent):
"""An object has been removed from a container"""
- __implements__ = IObjectRemovedEvent
+ implements(IObjectRemovedEvent)
class ObjectMovedEvent(ObjectAddedEvent):
"""An object has been moved"""
- __implements__ = IObjectMovedEvent
+ # XXX IObjectMovedEvent should derive from IObjectAddedEvent
+ implementsOnly(IObjectMovedEvent)
fromLocation = None
@@ -88,7 +90,7 @@
class ObjectCopiedEvent(ObjectAddedEvent):
"""An object has been copied"""
- __implements__ = IObjectCopiedEvent
+ implements(IObjectCopiedEvent)
fromLocation = None