[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ObjectHub - ObjectHub.py:1.5
Steve Alexander
steve@cat-box.net
Thu, 5 Dec 2002 08:54:53 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ObjectHub
In directory cvs.zope.org:/tmp/cvs-serv3653/lib/python/Zope/App/OFS/Services/ObjectHub
Modified Files:
ObjectHub.py
Log Message:
Make ObjectHub correctly deal with IObjectCreatedEvents.
Unit test to follow later, I promise!
=== Zope3/lib/python/Zope/App/OFS/Services/ObjectHub/ObjectHub.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ObjectHub/ObjectHub.py:1.4 Fri Nov 29 10:51:03 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ObjectHub/ObjectHub.py Thu Dec 5 08:54:52 2002
@@ -31,7 +31,7 @@
from Zope.Exceptions import NotFoundError
from Zope.Event.IObjectEvent import IObjectRemovedEvent, IObjectEvent
-from Zope.Event.IObjectEvent import IObjectMovedEvent
+from Zope.Event.IObjectEvent import IObjectMovedEvent, IObjectCreatedEvent
from Zope.Event.IObjectEvent import IObjectModifiedEvent
from Persistence.BTrees.IOBTree import IOBTree
@@ -119,6 +119,11 @@
canonical_new_location,
event.object)
clean_self._notify(wrapped_self, event)
+ elif IObjectCreatedEvent.isImplementedBy(event):
+ # a newly created object that has not been added to a
+ # container yet has no location. So, we're not interested in
+ # it.
+ pass
else:
canonical_location = locationAsTuple(event.location)
hubid = clean_self.__location_to_hubid.get(canonical_location)