logo       

Re: SVN: Products.Five/branches/regebro-traversal_refactor/ Removed last re: msg#00100

web.zope.z3base.five

Subject: Re: SVN: Products.Five/branches/regebro-traversal_refactor/ Removed last rests of Traversable usage. Deprecated Traversable and FiveTraversable.

Lennart Regebro wrote:
> Log message for revision 67698:
> Removed last rests of Traversable usage. Deprecated Traversable and
> FiveTraversable.

YAY!

> Modified: Products.Five/branches/regebro-traversal_refactor/traversable.py
> ===================================================================
> --- Products.Five/branches/regebro-traversal_refactor/traversable.py
> 2006-04-28 08:54:44 UTC (rev 67697)
> +++ Products.Five/branches/regebro-traversal_refactor/traversable.py
> 2006-04-28 09:25:33 UTC (rev 67698)
> @@ -15,6 +15,10 @@
>
> $Id$
> """
> +
> +import warnings
> +import zope.deprecation
> +
> from zope.component import getMultiAdapter, ComponentLookupError
> from zope.interface import implements, Interface
> from zope.publisher.interfaces import ILayer
> @@ -58,6 +62,13 @@
> # 2. Otherwise do attribute look-up or, if that doesn't work,
> # key item lookup.
>
> + if zope.deprecation.__show__():

This is usage of the show switch doesn't make any sense, by the way,
especially not when you're using warnings.warn afterwards.
DeprecationWarnings are disabled via the Python command line and a
global warning filter.

> + warnings.warn("The view lookup done by Traversable." \
> + "__bobo_traverse__ is now done by the standard " \
> + "traversal. This class is no longer needed and "
> + "will be removed in Zope 2.12.",
> + DeprecationWarning, 2)
> +
> if hasattr(self, '__fallback_traverse__'):
> try:
> return self.__fallback_traverse__(REQUEST, name)
> @@ -119,6 +130,14 @@

This deprecation warning doesn't make sense to me. IMO, the Traversable
class should become a deprecated and *empty* class, just so that
importing and subclassing it will still work. The rest of its
functionality should be useless now.

Note that in case you merge this branch after my 'zope33-port' branch,
you'll get a conflict on the Traversable class because I modified it on
the branch. That's ok, though. As said, Traversable should probably just
be completely empty.

> class FiveTraversable(DefaultTraversable):
>
> + def __init__(self, subject):
> + if zope.deprecation.__show__():
> + warnings.warn("The FiveTraversable class is no longer needed, " \
> + "and will be removed in Zope 2.12.",
> + DeprecationWarning, 2)
> +
> + self._subject = subject
> +
> def traverse(self, name, furtherPath):
> context = self._subject
> __traceback_info__ = (context, name, furtherPath)
>

You can remove this deprecation warnings again :). Five's 'zope33-port'
branch already got rid of FiveTraversable.

By the way, don't forget to put your estimate on when you'll be able to
merge your two branches into the Zope 2.10 wiki:
http://www.zope.org/Wikis/DevSite/Projects/Zope2.10/Tasks. Otherwise the
release managers might decide on an early feature freeze date. I will
merge my changes either Tuesday or Wednesday next week. Perhaps we
should coordinate, especially regarding Five.

Being-away-from-the-internet-for-the-weekend-ly,

Philipp



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise