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
7985e289
Commit
7985e289
authored
Oct 28, 2007
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backported discouraged warning for manage_* events from trunk
parent
2db4ddf4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
18 deletions
+16
-18
doc/CHANGES.txt
doc/CHANGES.txt
+7
-0
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+7
-14
lib/python/OFS/subscribers.py
lib/python/OFS/subscribers.py
+2
-4
No files found.
doc/CHANGES.txt
View file @
7985e289
...
@@ -6,6 +6,13 @@ Zope Changes
...
@@ -6,6 +6,13 @@ Zope Changes
Zope 2.10.5 (unreleased)
Zope 2.10.5 (unreleased)
Other changes
- Turned deprecation warnings for manage_afterAdd, manage_beforeDelete
and manage_afterClone methods into discouraged warnings. These methods
will not be removed in Zope 2.11, but stay for the foreseeable future.
Using events is still highly encouraged.
Bugs fixed
Bugs fixed
- Launchpad #147201: treat container-class in zope.conf as a string,
- Launchpad #147201: treat container-class in zope.conf as a string,
...
...
lib/python/OFS/CopySupport.py
View file @
7985e289
...
@@ -272,24 +272,21 @@ class CopyContainer(ExtensionClass.Base):
...
@@ -272,24 +272,21 @@ class CopyContainer(ExtensionClass.Base):
try
:
try
:
orig_container
.
_delObject
(
orig_id
,
suppress_events
=
True
)
orig_container
.
_delObject
(
orig_id
,
suppress_events
=
True
)
except
TypeError
:
except
TypeError
:
# BBB: removed in Zope 2.11
orig_container
.
_delObject
(
orig_id
)
orig_container
.
_delObject
(
orig_id
)
warnings
.
warn
(
warnings
.
warn
(
"%s._delObject without suppress_events is d
eprecated
"
"%s._delObject without suppress_events is d
iscouraged.
"
"and will be removed in Zope 2.11."
%
%
orig_container
.
__class__
.
__name__
,
orig_container
.
__class__
.
__name__
,
DeprecationWarning
)
DeprecationWarning
)
ob
=
aq_base
(
ob
)
ob
=
aq_base
(
ob
)
ob
.
_setId
(
id
)
ob
.
_setId
(
id
)
try
:
try
:
self
.
_setObject
(
id
,
ob
,
set_owner
=
0
,
suppress_events
=
True
)
self
.
_setObject
(
id
,
ob
,
set_owner
=
0
,
suppress_events
=
True
)
except
TypeError
:
except
TypeError
:
# BBB: removed in Zope 2.11
self
.
_setObject
(
id
,
ob
,
set_owner
=
0
)
self
.
_setObject
(
id
,
ob
,
set_owner
=
0
)
warnings
.
warn
(
warnings
.
warn
(
"%s._setObject without suppress_events is deprecated "
"%s._setObject without suppress_events is discouraged."
"and will be removed in Zope 2.11."
%
%
self
.
__class__
.
__name__
,
DeprecationWarning
)
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
))
...
@@ -362,11 +359,9 @@ class CopyContainer(ExtensionClass.Base):
...
@@ -362,11 +359,9 @@ class CopyContainer(ExtensionClass.Base):
try
:
try
:
self
.
_delObject
(
id
,
suppress_events
=
True
)
self
.
_delObject
(
id
,
suppress_events
=
True
)
except
TypeError
:
except
TypeError
:
# BBB: removed in Zope 2.11
self
.
_delObject
(
id
)
self
.
_delObject
(
id
)
warnings
.
warn
(
warnings
.
warn
(
"%s._delObject without suppress_events is deprecated "
"%s._delObject without suppress_events is discouraged."
%
"and will be removed in Zope 2.11."
%
self
.
__class__
.
__name__
,
DeprecationWarning
)
self
.
__class__
.
__name__
,
DeprecationWarning
)
ob
=
aq_base
(
ob
)
ob
=
aq_base
(
ob
)
ob
.
_setId
(
new_id
)
ob
.
_setId
(
new_id
)
...
@@ -376,11 +371,9 @@ class CopyContainer(ExtensionClass.Base):
...
@@ -376,11 +371,9 @@ class CopyContainer(ExtensionClass.Base):
try
:
try
:
self
.
_setObject
(
new_id
,
ob
,
set_owner
=
0
,
suppress_events
=
True
)
self
.
_setObject
(
new_id
,
ob
,
set_owner
=
0
,
suppress_events
=
True
)
except
TypeError
:
except
TypeError
:
# BBB: removed in Zope 2.11
self
.
_setObject
(
new_id
,
ob
,
set_owner
=
0
)
self
.
_setObject
(
new_id
,
ob
,
set_owner
=
0
)
warnings
.
warn
(
warnings
.
warn
(
"%s._setObject without suppress_events is deprecated "
"%s._setObject without suppress_events is discouraged."
%
"and will be removed in Zope 2.11."
%
self
.
__class__
.
__name__
,
DeprecationWarning
)
self
.
__class__
.
__name__
,
DeprecationWarning
)
ob
=
self
.
_getOb
(
new_id
)
ob
=
self
.
_getOb
(
new_id
)
...
...
lib/python/OFS/subscribers.py
View file @
7985e289
...
@@ -68,10 +68,8 @@ def maybeWarnDeprecated(ob, method_name):
...
@@ -68,10 +68,8 @@ def maybeWarnDeprecated(ob, method_name):
return
return
class_
=
ob
.
__class__
class_
=
ob
.
__class__
warnings
.
warn
(
warnings
.
warn
(
"%s.%s.%s is deprecated and will be removed in Zope 2.11, "
"%s.%s.%s is discouraged. You should use event subscribers instead."
%
"you should use event subscribers instead, and meanwhile "
(
class_
.
__module__
,
class_
.
__name__
,
method_name
),
"mark the class with <five:deprecatedManageAddDelete/>"
%
(
class_
.
__module__
,
class_
.
__name__
,
method_name
),
DeprecationWarning
)
DeprecationWarning
)
##################################################
##################################################
...
...
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