[Zope3-checkins] CVS: Zope3/src/zope/app/index - subscribers.py:1.17

Steve Alexander steve@cat-box.net
Fri, 13 Jun 2003 14:10:19 -0400


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

Modified Files:
	subscribers.py 
Log Message:
traverseName has been refactored, so this optimisation can be made


=== Zope3/src/zope/app/index/subscribers.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/index/subscribers.py:1.16	Sat Jun  7 02:37:26 2003
+++ Zope3/src/zope/app/index/subscribers.py	Fri Jun 13 14:10:18 2003
@@ -35,8 +35,9 @@
 from zope.app.interfaces.event import ISubscriber
 from zope.app.interfaces.event import IObjectAddedEvent
 from zope.app.interfaces.content.folder import IFolder
+from zope.app.interfaces.traversing import ITraversable
 from zope.context import ContextMethod
-from zope.component import getService
+from zope.component import getService, getAdapter
 from zope.app.services.servicenames import HubIds
 from zope.app.services.servicenames import EventSubscription
 
@@ -102,10 +103,9 @@
             return
         # Register subobjects
         names = object.keys()
+        traversable = getAdapter(object, ITraversable)
         for name in names:
-            # XXX Once traverseName is refactored, should get an
-            #     ITraversable from object and pass it to traverseName
-            sub_object = traverseName(object, name)
+            sub_object = traverseName(object, name, traversable=traversable)
             wrapped_self._registerTree(sub_object, hub)
     _registerTree = ContextMethod(_registerTree)