[Zope-Checkins]
SVN: Zope/branches/philikon-local-components/lib/python/OFS/subscribers.py
add adapter() declarations so that these are easier to register
Philipp von Weitershausen
philikon at philikon.de
Wed Apr 19 14:04:22 EDT 2006
Log message for revision 67162:
add adapter() declarations so that these are easier to register
Changed:
U Zope/branches/philikon-local-components/lib/python/OFS/subscribers.py
-=-
Modified: Zope/branches/philikon-local-components/lib/python/OFS/subscribers.py
===================================================================
--- Zope/branches/philikon-local-components/lib/python/OFS/subscribers.py 2006-04-19 17:51:30 UTC (rev 67161)
+++ Zope/branches/philikon-local-components/lib/python/OFS/subscribers.py 2006-04-19 18:04:21 UTC (rev 67162)
@@ -21,18 +21,18 @@
import sys
from logging import getLogger
+import OFS.interfaces
from Acquisition import aq_base
from App.config import getConfiguration
from AccessControl import getSecurityManager
from ZODB.POSException import ConflictError
-import OFS.interfaces
-from zope.interface import implements
-from zope.component import adapts
-from zope.location.interfaces import ISublocations
+import zope.component
+import zope.interface
+import zope.location.interfaces
from zope.app.container.contained import dispatchToSublocations
+from zope.app.container.interfaces import IObjectMovedEvent
-
deprecatedManageAddDeleteClasses = []
LOG = getLogger('OFS.subscribers')
@@ -79,8 +79,8 @@
class ObjectManagerSublocations(object):
"""Get the sublocations for an ObjectManager.
"""
- adapts(OFS.interfaces.IObjectManager)
- implements(ISublocations)
+ zope.component.adapts(OFS.interfaces.IObjectManager)
+ zope.interface.implements(zope.location.interfaces.ISublocations)
def __init__(self, container):
self.container = container
@@ -99,6 +99,8 @@
# could have a simple subscriber for IObjectManager that directly calls
# dispatchToSublocations.
+ at zope.component.adapter(OFS.interfaces.IItem,
+ OFS.interfaces.IObjectWillBeMovedEvent)
def dispatchObjectWillBeMovedEvent(ob, event):
"""Multi-subscriber for IItem + IObjectWillBeMovedEvent.
"""
@@ -108,6 +110,7 @@
# Next, do the manage_beforeDelete dance
callManageBeforeDelete(ob, event.object, event.oldParent)
+ at zope.component.adapter(OFS.interfaces.IItem, IObjectMovedEvent)
def dispatchObjectMovedEvent(ob, event):
"""Multi-subscriber for IItem + IObjectMovedEvent.
"""
@@ -117,6 +120,8 @@
if OFS.interfaces.IObjectManager.providedBy(ob):
dispatchToSublocations(ob, event)
+ at zope.component.adapter(OFS.interfaces.IItem,
+ OFS.interfaces.IObjectClonedEvent)
def dispatchObjectClonedEvent(ob, event):
"""Multi-subscriber for IItem + IObjectClonedEvent.
"""
More information about the Zope-Checkins
mailing list