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
02c27f8a
Commit
02c27f8a
authored
Nov 29, 2005
by
Florent Guillaume
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged r40408 from 2.9 branch:
Added backward compat for suppress_events parameter passing.
parent
be445689
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
6 deletions
+48
-6
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+37
-4
lib/python/OFS/OrderSupport.py
lib/python/OFS/OrderSupport.py
+11
-2
No files found.
lib/python/OFS/CopySupport.py
View file @
02c27f8a
...
@@ -16,6 +16,7 @@ $Id$
...
@@ -16,6 +16,7 @@ $Id$
"""
"""
import
re
,
sys
,
tempfile
import
re
,
sys
,
tempfile
import
warnings
from
cgi
import
escape
from
cgi
import
escape
from
marshal
import
loads
,
dumps
from
marshal
import
loads
,
dumps
from
urllib
import
quote
,
unquote
from
urllib
import
quote
,
unquote
...
@@ -267,11 +268,27 @@ class CopyContainer(ExtensionClass.Base):
...
@@ -267,11 +268,27 @@ class CopyContainer(ExtensionClass.Base):
# along to the new location if needed.
# along to the new location if needed.
ob
.
manage_changeOwnershipType
(
explicit
=
1
)
ob
.
manage_changeOwnershipType
(
explicit
=
1
)
orig_container
.
_delObject
(
orig_id
,
suppress_events
=
True
)
try
:
orig_container
.
_delObject
(
orig_id
,
suppress_events
=
True
)
except
TypeError
:
# BBB: removed in Zope 2.11
orig_container
.
_delObject
(
orig_id
)
warnings
.
warn
(
"%s._delObject without suppress_events is deprecated "
"and will be removed in Zope 2.11."
%
orig_container
.
__class__
.
__name__
,
DeprecationWarning
)
ob
=
aq_base
(
ob
)
ob
=
aq_base
(
ob
)
ob
.
_setId
(
id
)
ob
.
_setId
(
id
)
self
.
_setObject
(
id
,
ob
,
set_owner
=
0
,
suppress_events
=
True
)
try
:
self
.
_setObject
(
id
,
ob
,
set_owner
=
0
,
suppress_events
=
True
)
except
TypeError
:
# BBB: removed in Zope 2.11
self
.
_setObject
(
id
,
ob
,
set_owner
=
0
)
warnings
.
warn
(
"%s._setObject without suppress_events is deprecated "
"and will be removed in Zope 2.11."
%
self
.
__class__
.
__name__
,
DeprecationWarning
)
ob
=
self
.
_getOb
(
id
)
ob
=
self
.
_getOb
(
id
)
notify
(
ObjectMovedEvent
(
ob
,
orig_container
,
orig_id
,
self
,
id
))
notify
(
ObjectMovedEvent
(
ob
,
orig_container
,
orig_id
,
self
,
id
))
...
@@ -341,13 +358,29 @@ class CopyContainer(ExtensionClass.Base):
...
@@ -341,13 +358,29 @@ class CopyContainer(ExtensionClass.Base):
notify
(
ObjectWillBeMovedEvent
(
ob
,
self
,
id
,
self
,
new_id
))
notify
(
ObjectWillBeMovedEvent
(
ob
,
self
,
id
,
self
,
new_id
))
self
.
_delObject
(
id
,
suppress_events
=
True
)
try
:
self
.
_delObject
(
id
,
suppress_events
=
True
)
except
TypeError
:
# BBB: removed in Zope 2.11
self
.
_delObject
(
id
)
warnings
.
warn
(
"%s._delObject without suppress_events is deprecated "
"and will be removed in Zope 2.11."
%
self
.
__class__
.
__name__
,
DeprecationWarning
)
ob
=
aq_base
(
ob
)
ob
=
aq_base
(
ob
)
ob
.
_setId
(
new_id
)
ob
.
_setId
(
new_id
)
# Note - because a rename always keeps the same context, we
# Note - because a rename always keeps the same context, we
# can just leave the ownership info unchanged.
# can just leave the ownership info unchanged.
self
.
_setObject
(
new_id
,
ob
,
set_owner
=
0
,
suppress_events
=
True
)
try
:
self
.
_setObject
(
new_id
,
ob
,
set_owner
=
0
,
suppress_events
=
True
)
except
TypeError
:
# BBB: removed in Zope 2.11
self
.
_setObject
(
new_id
,
ob
,
set_owner
=
0
)
warnings
.
warn
(
"%s._setObject without suppress_events is deprecated "
"and will be removed in Zope 2.11."
%
self
.
__class__
.
__name__
,
DeprecationWarning
)
ob
=
self
.
_getOb
(
new_id
)
ob
=
self
.
_getOb
(
new_id
)
notify
(
ObjectMovedEvent
(
ob
,
self
,
id
,
self
,
new_id
))
notify
(
ObjectMovedEvent
(
ob
,
self
,
id
,
self
,
new_id
))
...
...
lib/python/OFS/OrderSupport.py
View file @
02c27f8a
...
@@ -16,7 +16,7 @@ $Id$
...
@@ -16,7 +16,7 @@ $Id$
"""
"""
from
types
import
StringType
from
types
import
StringType
import
warnings
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
ClassSecurityInfo
from
AccessControl.Permissions
import
access_contents_information
from
AccessControl.Permissions
import
access_contents_information
from
AccessControl.Permissions
import
manage_properties
from
AccessControl.Permissions
import
manage_properties
...
@@ -263,7 +263,16 @@ class OrderSupport(object):
...
@@ -263,7 +263,16 @@ class OrderSupport(object):
old_position
=
self
.
getObjectPosition
(
id
)
old_position
=
self
.
getObjectPosition
(
id
)
result
=
super
(
OrderSupport
,
self
).
manage_renameObject
(
id
,
new_id
,
result
=
super
(
OrderSupport
,
self
).
manage_renameObject
(
id
,
new_id
,
REQUEST
)
REQUEST
)
self
.
moveObjectToPosition
(
new_id
,
old_position
,
suppress_events
=
True
)
try
:
self
.
moveObjectToPosition
(
new_id
,
old_position
,
suppress_events
=
True
)
except
TypeError
:
# BBB: removed in Zope 2.11
self
.
moveObjectToPosition
(
new_id
,
old_position
)
warnings
.
warn
(
"%s.moveObjectToPosition without suppress_events is "
"deprecated and will be removed in Zope 2.11."
%
self
.
__class__
.
__name__
,
DeprecationWarning
)
return
result
return
result
def
tpValues
(
self
):
def
tpValues
(
self
):
...
...
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