[Checkins] SVN: zope.app.component/trunk/ Remove deprecated zope:content and zope:localUtility directives.
Dan Korostelev
nadako at gmail.com
Sat Dec 6 12:07:53 EST 2008
Log message for revision 93726:
Remove deprecated zope:content and zope:localUtility directives.
Changed:
U zope.app.component/trunk/CHANGES.txt
U zope.app.component/trunk/src/zope/app/component/contentdirective.py
U zope.app.component/trunk/src/zope/app/component/meta.zcml
U zope.app.component/trunk/src/zope/app/component/metadirectives.py
U zope.app.component/trunk/src/zope/app/component/tests/test_contentdirective.py
-=-
Modified: zope.app.component/trunk/CHANGES.txt
===================================================================
--- zope.app.component/trunk/CHANGES.txt 2008-12-06 16:37:27 UTC (rev 93725)
+++ zope.app.component/trunk/CHANGES.txt 2008-12-06 17:07:53 UTC (rev 93726)
@@ -5,6 +5,7 @@
3.5.1 (Unreleased)
------------------
+- Remove deprecated zope:content and zope:localUtility directives.
- Remove zope.app.component.fields module that
was pointing to the removed back35's LayerField.
- Remove "back35" extras_require as it doesn't make
Modified: zope.app.component/trunk/src/zope/app/component/contentdirective.py
===================================================================
--- zope.app.component/trunk/src/zope/app/component/contentdirective.py 2008-12-06 16:37:27 UTC (rev 93725)
+++ zope.app.component/trunk/src/zope/app/component/contentdirective.py 2008-12-06 17:07:53 UTC (rev 93726)
@@ -29,7 +29,6 @@
from zope.schema.interfaces import IField
from zope.configuration.exceptions import ConfigurationError
from zope.location.interfaces import ILocation
-from zope.annotation.interfaces import IAttributeAnnotatable
from zope.app.security.protectclass import protectLikeUnto, protectName
from zope.app.security.protectclass import protectSetAttribute
@@ -174,81 +173,3 @@
# same namespace, despite the utilities/content division
utility(_context, IFactory, factoryObj,
permission=PublicPermission, name=id)
-
-# BBB 2006/02/24, to be removed after 12 months
-class ContentDirective(ClassDirective):
- """ *BBB: DEPRECATED*
-
- The ``content`` alias for the ``class`` directive has been
- deprecated and will be removed in Zope 3.5.
- """
-
- def __init__(self, _context, class_):
- warnings.warn_explicit(
- "The 'content' alias for the 'class' directive has been "
- "deprecated and will be removed in Zope 3.5.\n",
- DeprecationWarning, _context.info.file, _context.info.line)
- super(ContentDirective, self).__init__(_context, class_)
-
-# BBB 2006/09/17, to be removed after 12 months
-class LocalUtilityDirective(ClassDirective):
- r"""*BBB: DEPRECATED*
-
- The ``localUtility`` directive has been deprecated
- and will be removed after 09/2007.
-
- Use ``class`` directive with additional subdirective
- ``<implements interface="zope.annotation.interfaces.IAttributeAnnotatable" />``
-
- Deprecated examples:
-
- >>> from zope.interface import implements
- >>> class LU1(object):
- ... pass
-
- >>> class LU2(LU1):
- ... implements(ILocation)
-
- >>> class LU3(LU1):
- ... __parent__ = None
-
- >>> class LU4(LU2):
- ... implements(IPersistent)
-
- >>> dir = LocalUtilityDirective(None, LU4)
- >>> IAttributeAnnotatable.implementedBy(LU4)
- True
-
- >>> LocalUtilityDirective(None, LU3)
- Traceback (most recent call last):
- ...
- ConfigurationError: Class `LU3` does not implement `IPersistent`.
-
- >>> LocalUtilityDirective(None, LU2)
- Traceback (most recent call last):
- ...
- ConfigurationError: Class `LU2` does not implement `IPersistent`.
-
- >>> LocalUtilityDirective(None, LU1)
- Traceback (most recent call last):
- ...
- ConfigurationError: Class `LU1` does not implement `ILocation`.
- """
-
- def __init__(self, _context, class_):
- if not ILocation.implementedBy(class_) and \
- not hasattr(class_, '__parent__'):
- raise ConfigurationError('Class `%s` does not implement '
- '`ILocation`.' % class_.__name__)
-
- if not IPersistent.implementedBy(class_):
- raise ConfigurationError('Class `%s` does not implement '
- '`IPersistent`.' % class_.__name__)
-
- warnings.warn_explicit(
- "The 'localUtility' directive has been deprecated. It will "
- "be removed after 09/2007.\n"
- "Use 'class' directive + implements(IAttributeAnnotatable).\n",
- DeprecationWarning, _context.info.file, _context.info.line)
- classImplements(class_, IAttributeAnnotatable)
- super(LocalUtilityDirective, self).__init__(_context, class_)
Modified: zope.app.component/trunk/src/zope/app/component/meta.zcml
===================================================================
--- zope.app.component/trunk/src/zope/app/component/meta.zcml 2008-12-06 16:37:27 UTC (rev 93725)
+++ zope.app.component/trunk/src/zope/app/component/meta.zcml 2008-12-06 17:07:53 UTC (rev 93726)
@@ -60,64 +60,6 @@
</meta:complexDirective>
- <!-- BBB 2006/02/24, to be removed after 12 months -->
- <meta:complexDirective
- name="content"
- schema=".metadirectives.IBBBClassDirective"
- handler=".contentdirective.ContentDirective"
- >
-
- <meta:subdirective
- name="implements"
- schema=".metadirectives.IImplementsSubdirective"
- />
-
- <meta:subdirective
- name="require"
- schema=".metadirectives.IRequireSubdirective"
- />
-
- <meta:subdirective
- name="allow"
- schema=".metadirectives.IAllowSubdirective"
- />
-
- <meta:subdirective
- name="factory"
- schema=".metadirectives.IFactorySubdirective"
- />
-
- </meta:complexDirective>
-
- <!-- BBB 2006/09/17, to be removed after 12 months -->
- <meta:complexDirective
- name="localUtility"
- schema=".metadirectives.IBBBClassDirective"
- handler=".contentdirective.LocalUtilityDirective"
- >
-
- <meta:subdirective
- name="implements"
- schema=".metadirectives.IImplementsSubdirective"
- />
-
- <meta:subdirective
- name="require"
- schema=".metadirectives.IRequireSubdirective"
- />
-
- <meta:subdirective
- name="allow"
- schema=".metadirectives.IAllowSubdirective"
- />
-
- <meta:subdirective
- name="factory"
- schema=".metadirectives.IFactorySubdirective"
- />
-
- </meta:complexDirective>
-
</meta:directives>
</configure>
Modified: zope.app.component/trunk/src/zope/app/component/metadirectives.py
===================================================================
--- zope.app.component/trunk/src/zope/app/component/metadirectives.py 2008-12-06 16:37:27 UTC (rev 93725)
+++ zope.app.component/trunk/src/zope/app/component/metadirectives.py 2008-12-06 17:07:53 UTC (rev 93726)
@@ -228,15 +228,6 @@
required=True
)
-# BBB 2006/09/17, to be removed after 12 months
-class IBBBClassDirective(IClassDirective):
- """ *BBB: DEPRECATED*
-
- It is discouraged to use ``content`` or ``localUtility`` directives.
- They are currently deprecated:
- only use ``class`` directive for class statements.
- """
-
class IImplementsSubdirective(zope.interface.Interface):
"""Declare that the class given by the content directive's class
attribute implements a given interface
Modified: zope.app.component/trunk/src/zope/app/component/tests/test_contentdirective.py
===================================================================
--- zope.app.component/trunk/src/zope/app/component/tests/test_contentdirective.py 2008-12-06 16:37:27 UTC (rev 93725)
+++ zope.app.component/trunk/src/zope/app/component/tests/test_contentdirective.py 2008-12-06 17:07:53 UTC (rev 93726)
@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Test 'zope:content' directive.
+"""Test 'zope:class' directive.
$Id$
"""
More information about the Checkins
mailing list