[Zope3-checkins] CVS: Zope3/src/zope/app/index - processors.py:1.6 subscribers.py:1.5
R. Sean Bowman
sean.bowman@acm.org
Wed, 5 Feb 2003 23:31:18 -0500
Update of /cvs-repository/Zope3/src/zope/app/index
In directory cvs.zope.org:/tmp/cvs-serv8752/zope/app/index
Modified Files:
processors.py subscribers.py
Log Message:
changed service names to use strings defined in
zope/component/servicenames.py, changed the name of
ErrorReportingService to ErrorReports
=== Zope3/src/zope/app/index/processors.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/index/processors.py:1.5 Mon Dec 30 13:43:06 2002
+++ Zope3/src/zope/app/index/processors.py Wed Feb 5 23:30:46 2003
@@ -24,6 +24,7 @@
from zope.app.interfaces.services.query import IQueryProcessor
from zope.component import getAdapter, getService
+from zope.component.servicenames import HubIds
from zope.proxy.context import ContextMethod
class ObjectRetrievingProcessor:
@@ -41,7 +42,7 @@
list = getAdapter(query, IRankedHubIdList)
batch = getAdapter(query, IBatchedResult)
- objectHub = getService(wrapped_self, "HubIds")
+ objectHub = getService(wrapped_self, HubIds)
# XXX do we need wrapping for the objects returned by the hub?
iterator = RankedObjectIterator(
=== Zope3/src/zope/app/index/subscribers.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/index/subscribers.py:1.4 Wed Feb 5 20:26:13 2003
+++ Zope3/src/zope/app/index/subscribers.py Wed Feb 5 23:30:46 2003
@@ -37,6 +37,7 @@
from zope.app.interfaces.content.folder import IFolder
from zope.proxy.context import ContextMethod
from zope.component import getService, queryAdapter
+from zope.component.servicenames import HubIds, Events
from zope.app.traversing import traverse, traverseName, \
getPhysicalPath, getPhysicalRoot
@@ -61,7 +62,7 @@
def notify(wrapped_self, event):
"""An event occured. Perhaps register this object with the hub."""
- hub = getService(wrapped_self, "HubIds")
+ hub = getService(wrapped_self, HubIds)
wrapped_self._registerObject(event.object, hub)
notify = ContextMethod(notify)
@@ -70,7 +71,7 @@
def subscribe(wrapped_self):
if wrapped_self.currentlySubscribed:
raise RuntimeError, "already subscribed; please unsubscribe first"
- events = getService(wrapped_self, "Events")
+ events = getService(wrapped_self, Events)
events.subscribe(wrapped_self, IObjectAddedEvent)
wrapped_self.currentlySubscribed = True
subscribe = ContextMethod(subscribe)
@@ -78,7 +79,7 @@
def unsubscribe(wrapped_self):
if not wrapped_self.currentlySubscribed:
raise RuntimeError, "not subscribed; please subscribe first"
- events = getService(wrapped_self, "Events")
+ events = getService(wrapped_self, Events)
events.unsubscribe(wrapped_self, IObjectAddedEvent)
wrapped_self.currentlySubscribed = False
unsubscribe = ContextMethod(unsubscribe)
@@ -88,7 +89,7 @@
def registerExisting(wrapped_self):
object = findContentObject(wrapped_self)
- hub = getService(wrapped_self, "HubIds")
+ hub = getService(wrapped_self, HubIds)
wrapped_self._registerTree(object, hub)
registerExisting = ContextMethod(registerExisting)