[Zope3-dev] Re: SVN: Zope3/trunk/ Deprecate directive <zope:localUtility>.

Philipp von Weitershausen philipp at weitershausen.de
Sun Sep 17 17:25:39 EDT 2006


Florent Xicluna wrote:
> Log message for revision 70213:
>   Deprecate directive <zope:localUtility>.
>   Remove deprecated directive <zope:defaultLayer>.

Hi Florent,

a few comments:

> Modified: Zope3/trunk/src/zope/app/component/contentdirective.py
> ===================================================================
> --- Zope3/trunk/src/zope/app/component/contentdirective.py	2006-09-17 15:06:34 UTC (rev 70212)
> +++ Zope3/trunk/src/zope/app/component/contentdirective.py	2006-09-17 15:31:01 UTC (rev 70213)
> @@ -187,12 +187,16 @@
>          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)        
> +            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"""localUtility directive handler.
> +    r""" *BBB: DEPRECATED*
>  
> +    The ``localUtility`` alias for the ``class`` directive has been
> +    deprecated and will be removed in Zope 3.5.
> +
>      Examples:
>  
>        >>> from zope.interface import implements
> @@ -238,6 +242,9 @@
>              raise ConfigurationError('Class `%s` does not implement '
>                                       '`IPersistent`.' % class_.__name__)
>  
> +        warnings.warn_explicit(
> +            "The 'localUtility' alias for the 'class' directive has been "
> +            "deprecated and will be removed in Zope 3.5.\n",
> +            DeprecationWarning, _context.info.file, _context.info.line)
>          classImplements(class_, IAttributeAnnotatable)
> -
>          super(LocalUtilityDirective, self).__init__(_context, class_)

The deprecation warning is incorrect. First, the localUtility directive 
will be removed in Zope 3.6. Second, localUtility is NOT just an alias 
to 'class'. It's equivalent to class + 
implements(IAttributeAnnotatable). This should be mentioned in the warning.

> Modified: Zope3/trunk/src/zope/app/http/exception/configure.zcml
> ===================================================================
> --- Zope3/trunk/src/zope/app/http/exception/configure.zcml	2006-09-17 15:06:34 UTC (rev 70212)
> +++ Zope3/trunk/src/zope/app/http/exception/configure.zcml	2006-09-17 15:31:01 UTC (rev 70213)
> @@ -1,4 +1,5 @@
> -<configure xmlns="http://namespaces.zope.org/zope">
> +<configure
> +    xmlns="http://namespaces.zope.org/zope">

Do we really need this kind of whitespace conformity? (and conformance 
to what?). Your work is appreciated, but I think there are more urgent 
issues than the lack of whitespace conformance.

> Modified: Zope3/trunk/src/zope/app/principalannotation/interfaces.py
> ===================================================================
> --- Zope3/trunk/src/zope/app/principalannotation/interfaces.py	2006-09-17 15:06:34 UTC (rev 70212)
> +++ Zope3/trunk/src/zope/app/principalannotation/interfaces.py	2006-09-17 15:31:01 UTC (rev 70213)
> @@ -40,8 +40,3 @@
>      def hasAnnotations(principal):
>          """Return boolean indicating if given `IPrincipal` has
>          `IAnnotations`."""
> -
> -#############################################################################
> -# BBB: 12/20/2004
> -IPrincipalAnnotationService = IPrincipalAnnotationUtility
> -#############################################################################

This doesn't seem to belong in this check-in.

Philipp


More information about the Zope3-dev mailing list