[Zope3-checkins] CVS: Zope3/src/zope/app/services - event.py:1.9
R. Sean Bowman
sean.bowman@acm.org
Wed, 5 Feb 2003 23:31:26 -0500
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv8752/zope/app/services
Modified Files:
event.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/services/event.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/services/event.py:1.8 Mon Feb 3 10:59:16 2003
+++ Zope3/src/zope/app/services/event.py Wed Feb 5 23:30:52 2003
@@ -28,6 +28,7 @@
from zope.component import getAdapter, queryAdapter, getService, queryService
from zope.component import ComponentLookupError
+from zope.component.servicenames import HubIds, Events, Subscription
from zope.app.component.nextservice import getNextService, queryNextService
from zope.proxy.context import ContextMethod, ContextSuper
@@ -37,7 +38,7 @@
def getSubscriptionService(context):
- return getService(context, "Subscription")
+ return getService(context, Subscription)
def subscribe(subscriber, event_type=IEvent, filter=None, context=None):
if context is None and not isinstance(subscriber, (int, str, unicode)):
@@ -81,7 +82,7 @@
def _notify(clean_self, wrapped_self, event):
subscriptionsForEvent = clean_self._registry.getAllForObject(event)
- hubGet = getService(wrapped_self, "HubIds").getObject
+ hubGet = getService(wrapped_self, HubIds).getObject
pathGet = getAdapter(wrapped_self, ITraverser).traverse
badSubscribers = {}
@@ -321,7 +322,7 @@
else:
publishedEvents.append(event)
if (clean_self.isPromotableEvent(event)):
- getNextService(wrapped_self, 'Events').publish(event)
+ getNextService(wrapped_self, Events).publish(event)
publishedEvents.remove(event)
publish = ContextMethod(publish)
@@ -336,12 +337,12 @@
def bound(wrapped_self, name):
"See IBindingAware"
ContextSuper(EventService, wrapped_self).bound(name)
- if name == "Subscription":
+ if name == Subscription:
clean_self = removeAllProxies(wrapped_self)
clean_self._serviceName = name # for LocalServiceSubscribable
if clean_self.subscribeOnBind:
try:
- es = getNextService(wrapped_self, "Subscription")
+ es = getNextService(wrapped_self, Subscription)
except ComponentLookupError:
pass
else:
@@ -350,7 +351,7 @@
def unbound(wrapped_self, name):
"See IBindingAware"
- if name == "Subscription":
+ if name == Subscription:
clean_self = removeAllProxies(wrapped_self)
clean_self._v_unbinding = True
try:
@@ -392,13 +393,13 @@
if ISubscriptionService.isImplementedBy(
removeAllProxies(clean_subscribable)):
try:
- context = getService(wrapped_self, "Subscription")
+ context = getService(wrapped_self, Subscription)
# we do this instead of getNextService because the order
# of unbinding and notification of unbinding is not
# guaranteed
while removeAllProxies(context) in (
clean_subscribable, clean_self):
- context = getNextService(context, "Subscription")
+ context = getNextService(context, Subscription)
except ComponentLookupError:
pass
else: