[Zope-Checkins] SVN: Zope/trunk/ Turned deprecation warnings for
manage_afterAdd,
manage_beforeDelete and manage_afterClone methods into discouraged
warnings.
Hanno Schlichting
plone at hannosch.info
Mon Oct 22 18:06:22 EDT 2007
Log message for revision 80954:
Turned deprecation warnings for manage_afterAdd, manage_beforeDelete and manage_afterClone methods into discouraged warnings.
Changed:
U Zope/trunk/doc/CHANGES.txt
U Zope/trunk/lib/python/OFS/CopySupport.py
U Zope/trunk/lib/python/OFS/subscribers.py
U Zope/trunk/lib/python/Products/Five/deprecated.zcml
U Zope/trunk/lib/python/Products/Five/doc/event.txt
U Zope/trunk/lib/python/Products/Five/eventconfigure.py
-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt 2007-10-22 21:53:37 UTC (rev 80953)
+++ Zope/trunk/doc/CHANGES.txt 2007-10-22 22:06:21 UTC (rev 80954)
@@ -9,6 +9,11 @@
Restructuring
+ - 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.
+
- Moved two implements declarations from Five into the proper classes.
- Document.sequence: replaced by zope.sequencesort
Modified: Zope/trunk/lib/python/OFS/CopySupport.py
===================================================================
--- Zope/trunk/lib/python/OFS/CopySupport.py 2007-10-22 21:53:37 UTC (rev 80953)
+++ Zope/trunk/lib/python/OFS/CopySupport.py 2007-10-22 22:06:21 UTC (rev 80954)
@@ -272,24 +272,21 @@
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)
+ "%s._delObject without suppress_events is discouraged."
+ % orig_container.__class__.__name__,
+ DeprecationWarning)
ob = aq_base(ob)
ob._setId(id)
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)
+ "%s._setObject without suppress_events is discouraged."
+ % self.__class__.__name__, DeprecationWarning)
ob = self._getOb(id)
notify(ObjectMovedEvent(ob, orig_container, orig_id, self, id))
@@ -362,11 +359,9 @@
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." %
+ "%s._delObject without suppress_events is discouraged." %
self.__class__.__name__, DeprecationWarning)
ob = aq_base(ob)
ob._setId(new_id)
@@ -376,11 +371,9 @@
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." %
+ "%s._setObject without suppress_events is discouraged." %
self.__class__.__name__, DeprecationWarning)
ob = self._getOb(new_id)
Modified: Zope/trunk/lib/python/OFS/subscribers.py
===================================================================
--- Zope/trunk/lib/python/OFS/subscribers.py 2007-10-22 21:53:37 UTC (rev 80953)
+++ Zope/trunk/lib/python/OFS/subscribers.py 2007-10-22 22:06:21 UTC (rev 80954)
@@ -68,10 +68,8 @@
return
class_ = ob.__class__
warnings.warn(
- "%s.%s.%s is deprecated and will be removed in Zope 2.11, "
- "you should use event subscribers instead, and meanwhile "
- "mark the class with <five:deprecatedManageAddDelete/>"
- % (class_.__module__, class_.__name__, method_name),
+ "%s.%s.%s is discouraged. You should use event subscribers instead." %
+ (class_.__module__, class_.__name__, method_name),
DeprecationWarning)
##################################################
Modified: Zope/trunk/lib/python/Products/Five/deprecated.zcml
===================================================================
--- Zope/trunk/lib/python/Products/Five/deprecated.zcml 2007-10-22 21:53:37 UTC (rev 80953)
+++ Zope/trunk/lib/python/Products/Five/deprecated.zcml 2007-10-22 22:06:21 UTC (rev 80954)
@@ -1,7 +1,7 @@
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five">
- <!-- deprecated in core Zope, should be fixed there in Zope 2.9 -->
+ <!-- deprecated in core Zope, should be fixed there -->
<five:deprecatedManageAddDelete
class="AccessControl.User.BasicUserFolder"/>
Modified: Zope/trunk/lib/python/Products/Five/doc/event.txt
===================================================================
--- Zope/trunk/lib/python/Products/Five/doc/event.txt 2007-10-22 21:53:37 UTC (rev 80953)
+++ Zope/trunk/lib/python/Products/Five/doc/event.txt 2007-10-22 22:06:21 UTC (rev 80954)
@@ -10,7 +10,7 @@
to register a subscriber for the appropriate event, for instance
IObjectAddedEvent, and make it do the work.
-Indeed, the old methods like ``manage_afterAdd`` are now deprecated, you
+Indeed, the old methods like ``manage_afterAdd`` are now discouraged, you
shouldn't use them anymore.
Let's see how to migrate your products.
@@ -47,8 +47,7 @@
telling you that::
Calling Products.CoolProduct.CoolDocument.CoolDocument.manage_afterAdd
- is deprecated when using Five, instead use event subscribers or mark
- the class with <five:deprecatedManageAddDelete/>
+ is discouraged. You should use event subscribers instead.
Using five:deprecatedManageAddDelete
------------------------------------
@@ -78,8 +77,8 @@
by hand. If you call the super class, you will get a warning, saying for
instance::
- CoolDocument.manage_afterAdd is deprecated and will be removed in
- Zope 2.11, you should use an IObjectAddedEvent subscriber instead.
+ CoolDocument.manage_afterAdd is discouraged. You
+ should use an IObjectAddedEvent subscriber instead.
The fact that you must "just do your work" is especially important for
the rare cases where people subclass the ``manage_afterAdd`` of object
Modified: Zope/trunk/lib/python/Products/Five/eventconfigure.py
===================================================================
--- Zope/trunk/lib/python/Products/Five/eventconfigure.py 2007-10-22 21:53:37 UTC (rev 80953)
+++ Zope/trunk/lib/python/Products/Five/eventconfigure.py 2007-10-22 22:06:21 UTC (rev 80954)
@@ -23,7 +23,7 @@
def setContainerEvents():
warnings.warn("Using <five:containerEvents/> is deprecated (it is now "
- "the default), it will be removed in Zope 2.11",
+ "the default).",
DeprecationWarning)
def setDeprecatedManageAddDelete(class_):
More information about the Zope-Checkins
mailing list