[Zope3-checkins] CVS: Zope3/src/zope/app/index/field - index.py:1.13

Jim Fulton jim at zope.com
Sun Sep 21 13:32:25 EDT 2003


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

Modified Files:
	index.py 
Log Message:
No-longer use context wrappers.


=== Zope3/src/zope/app/index/field/index.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/index/field/index.py:1.12	Sun Aug 17 02:06:51 2003
+++ Zope3/src/zope/app/index/field/index.py	Sun Sep 21 13:31:54 2003
@@ -23,19 +23,18 @@
 
 from zope.component import getService
 from zope.app.services.servicenames import HubIds
-from zope.context import ContextMethod
+from zope.app.interfaces.event import ISubscriber
 from zope.index.field.index import FieldIndex as FieldIndexWrapper
 from zope.interface import implements
-
-from zope.app.interfaces.services.hub import \
-     IRegistrationHubEvent, \
-     IObjectModifiedHubEvent
-
+from zope.app.container.contained import Contained
+from zope.app.interfaces.services.hub import IObjectModifiedHubEvent
+from zope.app.interfaces.services.hub import IRegistrationHubEvent
 from zope.app.interfaces.index.field import IUIFieldIndex, IUIFieldCatalogIndex
 from zope.app.interfaces.catalog.index import ICatalogIndex
 from zope.app.index import InterfaceIndexingSubscriber
 
-class FieldCatalogIndex(InterfaceIndexingSubscriber, FieldIndexWrapper):
+class FieldCatalogIndex(InterfaceIndexingSubscriber, FieldIndexWrapper,
+                        Contained):
     implements(ICatalogIndex, IUIFieldCatalogIndex)
 
 class FieldIndex(FieldCatalogIndex):
@@ -53,7 +52,6 @@
         if update:
             self._update(channel.iterObjectRegistrations())
         self.currentlySubscribed = True
-    subscribe = ContextMethod(subscribe)
 
     def unsubscribe(self, channel=None):
         if not self.currentlySubscribed:
@@ -62,7 +60,6 @@
         channel.unsubscribe(self, IObjectModifiedHubEvent)
         channel.unsubscribe(self, IRegistrationHubEvent)
         self.currentlySubscribed = False
-    unsubscribe = ContextMethod(unsubscribe)
 
     def isSubscribed(self):
         return self.currentlySubscribed
@@ -71,11 +68,9 @@
         if channel is None:
             channel = getService(self, HubIds)
         return channel
-    _getChannel = ContextMethod(_getChannel)
 
     def _update(self, registrations):
         for location, hubid, wrapped_object in registrations:
             value = self._getValue(wrapped_object)
             if value is not None:
                 self.index_doc(hubid, value)
-    _update = ContextMethod(_update)




More information about the Zope3-Checkins mailing list