[Zope3-checkins] CVS: Zope3/src/zope/app/event - objectevent.py:1.6.24.2

Jim Fulton jim at zope.com
Mon Sep 15 14:13:02 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	objectevent.py 
Log Message:
Got lots of tests to pass.

Added a setitem helper function to be used to help satisfy container
contracts.



=== Zope3/src/zope/app/event/objectevent.py 1.6.24.1 => 1.6.24.2 ===
--- Zope3/src/zope/app/event/objectevent.py:1.6.24.1	Fri Sep 12 15:15:24 2003
+++ Zope3/src/zope/app/event/objectevent.py	Mon Sep 15 14:12:31 2003
@@ -25,6 +25,7 @@
 from zope.app.interfaces.event import IObjectContentModifiedEvent
 from zope.app.traversing import getPath
 from zope.interface import implements
+from zope.app.event import publish
 
 _marker = object()
 
@@ -33,16 +34,8 @@
 
     implements(IObjectEvent)
 
-    def _getLocation(self):
-        if self.__location is not _marker:
-            return self.__location
-        return getPath(self.object)
-
-    location = property(_getLocation)
-
-    def __init__(self, object, location=_marker):
+    def __init__(self, object):
         self.object = object
-        self.__location = location
 
 class ObjectCreatedEvent(ObjectEvent):
     """An object has been created"""
@@ -54,15 +47,24 @@
 
     implements(IObjectModifiedEvent)
 
+def modified(object):
+    publish(object, ObjectModifiedEvent(object))
+
 class ObjectAnnotationsModifiedEvent(ObjectModifiedEvent):
     """An object's annotations have been modified"""
 
     implements(IObjectAnnotationsModifiedEvent)
 
+def annotationModified(object):
+    publish(object, ObjectAnnotationModifiedEvent(object))
+
 class ObjectContentModifiedEvent(ObjectModifiedEvent):
     """An object's content has been modified"""
 
     implements(IObjectContentModifiedEvent)
+
+def contentModified(object):
+    publish(object, ObjectContentModifiedEvent(object))
 
 class ObjectCopiedEvent(ObjectCreatedEvent):
     """An object has been copied"""




More information about the Zope3-Checkins mailing list