[Zope3-checkins] CVS: Zope3/src/zope/app/index - processors.py:1.8.22.1 queries.py:1.4.10.1 subscribers.py:1.14.10.1

Grégoire Weber zope@i-con.ch
Sun, 22 Jun 2003 10:24:09 -0400


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

Modified Files:
      Tag: cw-mail-branch
	processors.py queries.py subscribers.py 
Log Message:
Synced up with HEAD

=== Zope3/src/zope/app/index/processors.py 1.8 => 1.8.22.1 ===
--- Zope3/src/zope/app/index/processors.py:1.8	Tue Feb 11 21:17:23 2003
+++ Zope3/src/zope/app/index/processors.py	Sun Jun 22 10:23:08 2003
@@ -25,7 +25,8 @@
 
 from zope.component import getAdapter, getService
 from zope.app.services.servicenames import HubIds
-from zope.proxy.context import ContextMethod
+from zope.context import ContextMethod
+from zope.interface import implements
 
 class ObjectRetrievingProcessor:
     """Converts a RankedHubIdList into an iteratable
@@ -33,7 +34,7 @@
        from the ObjectHub.
     """
 
-    __implements__ = IQueryProcessor
+    implements(IQueryProcessor)
 
     inputInterfaces = (IRankedHubIdList, IBatchedResult)
     outputInterfaces = (IRankedObjectIterator,)
@@ -56,7 +57,7 @@
 class RankedObjectIterator:
     """Iterates over a given list of IRankedObjectRecord."""
 
-    __implements__ = IRankedObjectIterator, IBatchedResult
+    implements(IRankedObjectIterator, IBatchedResult)
 
     def __init__(self, recordlist, objectfetcher, startposition,
                  batchsize, totalsize):
@@ -81,7 +82,7 @@
 
     __slots__ = ["rank", "object"]
 
-    __implements__ = IRankedObjectRecord
+    implements(IRankedObjectRecord)
 
     def __init__(self, object, rank):
         self.rank = rank


=== Zope3/src/zope/app/index/queries.py 1.4 => 1.4.10.1 ===
--- Zope3/src/zope/app/index/queries.py:1.4	Thu May  1 15:35:18 2003
+++ Zope3/src/zope/app/index/queries.py	Sun Jun 22 10:23:08 2003
@@ -16,12 +16,13 @@
 $Id$
 """
 
-from zope.app.interfaces.index.interfaces\
-     import IBatchedResult, IRankedHubIdList
+from zope.app.interfaces.index.interfaces import IBatchedResult
+from zope.app.interfaces.index.interfaces import IRankedHubIdList
+from zope.interface import implements
 
 class BatchedRankedResult:
 
-    __implements__ = IBatchedResult, IRankedHubIdList
+    implements(IBatchedResult, IRankedHubIdList)
 
     def __init__(self, hubidlist, startposition, batchsize, totalsize):
         self.__hubidlist = hubidlist


=== Zope3/src/zope/app/index/subscribers.py 1.14 => 1.14.10.1 ===
--- Zope3/src/zope/app/index/subscribers.py:1.14	Thu May  1 15:35:18 2003
+++ Zope3/src/zope/app/index/subscribers.py	Sun Jun 22 10:23:08 2003
@@ -29,14 +29,15 @@
 """
 __metaclass__ = type
 
-from zope.interface import Interface
+from zope.interface import Interface, implements
 from persistence import Persistent
 
 from zope.app.interfaces.event import ISubscriber
 from zope.app.interfaces.event import IObjectAddedEvent
 from zope.app.interfaces.content.folder import IFolder
-from zope.proxy.context import ContextMethod
-from zope.component import getService
+from zope.app.interfaces.traversing import ITraversable
+from zope.context import ContextMethod
+from zope.component import getService, getAdapter
 from zope.app.services.servicenames import HubIds
 from zope.app.services.servicenames import EventSubscription
 
@@ -58,7 +59,7 @@
 
 class Registration(Persistent):
 
-    __implements__ = ISubscriptionControl, ISubscriber
+    implements(ISubscriptionControl, ISubscriber)
 
     def notify(wrapped_self, event):
         """An event occured. Perhaps register this object with the hub."""
@@ -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)