Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
c5b0f751
Commit
c5b0f751
authored
Apr 19, 2006
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add adapter() declarations so that these are easier to register
parent
d4df2441
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
lib/python/OFS/subscribers.py
lib/python/OFS/subscribers.py
+12
-7
No files found.
lib/python/OFS/subscribers.py
View file @
c5b0f751
...
...
@@ -21,17 +21,17 @@ import warnings
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
ISublocation
s
import
zope.component
import
zope.interface
import
zope.location.interface
s
from
zope.app.container.contained
import
dispatchToSublocations
from
zope.app.container.interfaces
import
IObjectMovedEvent
deprecatedManageAddDeleteClasses
=
[]
...
...
@@ -79,8 +79,8 @@ def maybeWarnDeprecated(ob, method_name):
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 @@ class ObjectManagerSublocations(object):
# could have a simple subscriber for IObjectManager that directly calls
# dispatchToSublocations.
@
zope
.
component
.
adapter
(
OFS
.
interfaces
.
IItem
,
OFS
.
interfaces
.
IObjectWillBeMovedEvent
)
def
dispatchObjectWillBeMovedEvent
(
ob
,
event
):
"""Multi-subscriber for IItem + IObjectWillBeMovedEvent.
"""
...
...
@@ -108,6 +110,7 @@ def dispatchObjectWillBeMovedEvent(ob, event):
# Next, do the manage_beforeDelete dance
callManageBeforeDelete
(
ob
,
event
.
object
,
event
.
oldParent
)
@
zope
.
component
.
adapter
(
OFS
.
interfaces
.
IItem
,
IObjectMovedEvent
)
def
dispatchObjectMovedEvent
(
ob
,
event
):
"""Multi-subscriber for IItem + IObjectMovedEvent.
"""
...
...
@@ -117,6 +120,8 @@ def dispatchObjectMovedEvent(ob, event):
if
OFS
.
interfaces
.
IObjectManager
.
providedBy
(
ob
):
dispatchToSublocations
(
ob
,
event
)
@
zope
.
component
.
adapter
(
OFS
.
interfaces
.
IItem
,
OFS
.
interfaces
.
IObjectClonedEvent
)
def
dispatchObjectClonedEvent
(
ob
,
event
):
"""Multi-subscriber for IItem + IObjectClonedEvent.
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment