[Checkins] SVN: zope.traversing/trunk/ Brought ITraverser back from zope.location where it had been moved to invert
Thomas Lotze
tl at gocept.com
Thu Sep 24 07:19:15 EDT 2009
Log message for revision 104478:
Brought ITraverser back from zope.location where it had been moved to invert
the package interdependency, but is no longer used now.
Changed:
U zope.traversing/trunk/CHANGES.txt
U zope.traversing/trunk/setup.py
U zope.traversing/trunk/src/zope/traversing/adapters.py
U zope.traversing/trunk/src/zope/traversing/api.py
U zope.traversing/trunk/src/zope/traversing/configure.zcml
U zope.traversing/trunk/src/zope/traversing/interfaces.py
U zope.traversing/trunk/src/zope/traversing/testing.py
U zope.traversing/trunk/src/zope/traversing/tests/test_conveniencefunctions.py
U zope.traversing/trunk/src/zope/traversing/tests/test_traverser.py
-=-
Modified: zope.traversing/trunk/CHANGES.txt
===================================================================
--- zope.traversing/trunk/CHANGES.txt 2009-09-24 09:41:25 UTC (rev 104477)
+++ zope.traversing/trunk/CHANGES.txt 2009-09-24 11:19:14 UTC (rev 104478)
@@ -2,10 +2,13 @@
Changes
=======
-3.7.3 (unreleased)
+3.8.0 (unreleased)
------------------
+- Brought ITraverser back from zope.location where it had been moved to invert
+ the package interdependency, but is no longer used now.
+
3.7.2 (2009-08-29)
------------------
Modified: zope.traversing/trunk/setup.py
===================================================================
--- zope.traversing/trunk/setup.py 2009-09-24 09:41:25 UTC (rev 104477)
+++ zope.traversing/trunk/setup.py 2009-09-24 11:19:14 UTC (rev 104478)
@@ -27,7 +27,7 @@
open('CHANGES.txt').read())
setup(name='zope.traversing',
- version = '3.7.3dev',
+ version = '3.8.0dev',
url='http://pypi.python.org/pypi/zope.traversing',
license='ZPL 2.1',
author='Zope Corporation and Contributors',
@@ -58,7 +58,7 @@
'zope.proxy',
'zope.publisher',
'zope.security',
- 'zope.location>=3.5.2',
+ 'zope.location>=3.7.0dev',
],
include_package_data = True,
zip_safe = False,
Modified: zope.traversing/trunk/src/zope/traversing/adapters.py
===================================================================
--- zope.traversing/trunk/src/zope/traversing/adapters.py 2009-09-24 09:41:25 UTC (rev 104477)
+++ zope.traversing/trunk/src/zope/traversing/adapters.py 2009-09-24 11:19:14 UTC (rev 104478)
@@ -20,9 +20,8 @@
import zope.interface
import zope.component
-from zope.location.interfaces \
- import ILocationInfo, LocationError, ITraverser
-from zope.traversing.interfaces import ITraversable
+from zope.location.interfaces import ILocationInfo, LocationError
+from zope.traversing.interfaces import ITraversable, ITraverser
from zope.traversing.namespace import namespaceLookup
from zope.traversing.namespace import UnexpectedParameters
Modified: zope.traversing/trunk/src/zope/traversing/api.py
===================================================================
--- zope.traversing/trunk/src/zope/traversing/api.py 2009-09-24 09:41:25 UTC (rev 104477)
+++ zope.traversing/trunk/src/zope/traversing/api.py 2009-09-24 11:19:14 UTC (rev 104478)
@@ -16,9 +16,8 @@
$Id$
"""
from zope.interface import moduleProvides
-from zope.location.interfaces \
- import ILocationInfo, IRoot, LocationError, ITraverser
-from zope.traversing.interfaces import ITraversalAPI
+from zope.location.interfaces import ILocationInfo, IRoot, LocationError
+from zope.traversing.interfaces import ITraversalAPI, ITraverser
moduleProvides(ITraversalAPI)
__all__ = tuple(ITraversalAPI)
Modified: zope.traversing/trunk/src/zope/traversing/configure.zcml
===================================================================
--- zope.traversing/trunk/src/zope/traversing/configure.zcml 2009-09-24 09:41:25 UTC (rev 104477)
+++ zope.traversing/trunk/src/zope/traversing/configure.zcml 2009-09-24 11:19:14 UTC (rev 104478)
@@ -4,7 +4,7 @@
<adapter
for="*"
factory="zope.traversing.adapters.Traverser"
- provides="zope.location.interfaces.ITraverser" />
+ provides="zope.traversing.interfaces.ITraverser" />
<adapter
for="*"
Modified: zope.traversing/trunk/src/zope/traversing/interfaces.py
===================================================================
--- zope.traversing/trunk/src/zope/traversing/interfaces.py 2009-09-24 09:41:25 UTC (rev 104477)
+++ zope.traversing/trunk/src/zope/traversing/interfaces.py 2009-09-24 11:19:14 UTC (rev 104478)
@@ -22,9 +22,11 @@
from zope.location.interfaces import LocationError as TraversalError
from zope.location.interfaces import IRoot as IContainmentRoot
from zope.location.interfaces import ILocationInfo as IPhysicallyLocatable
-from zope.location.interfaces import ITraverser
+_RAISE_KEYERROR = object()
+
+
class ITraversable(Interface):
"""To traverse an object, this interface must be provided"""
@@ -40,6 +42,29 @@
method is allowed to change the contents of furtherPath.
"""
+
+class ITraverser(Interface):
+ """Provide traverse features"""
+
+ # XXX This is used like a utility but implemented as an adapter: The
+ # traversal policy is only implemented once and repeated for all objects
+ # along the path.
+
+ def traverse(path, default=_RAISE_KEYERROR):
+ """Return an object given a path.
+
+ Path is either an immutable sequence of strings or a slash ('/')
+ delimited string.
+
+ If the first string in the path sequence is an empty string, or the
+ path begins with a '/', start at the root. Otherwise the path is
+ relative to the current context.
+
+ If the object is not found, return 'default' argument.
+
+ """
+
+
class ITraversalAPI(Interface):
"""Common API functions to ease traversal computations
"""
Modified: zope.traversing/trunk/src/zope/traversing/testing.py
===================================================================
--- zope.traversing/trunk/src/zope/traversing/testing.py 2009-09-24 09:41:25 UTC (rev 104477)
+++ zope.traversing/trunk/src/zope/traversing/testing.py 2009-09-24 11:19:14 UTC (rev 104478)
@@ -22,8 +22,8 @@
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
from zope.location.traversing \
import LocationPhysicallyLocatable, RootPhysicallyLocatable
-from zope.location.interfaces import ILocationInfo, IRoot, ITraverser
-from zope.traversing.interfaces import ITraversable
+from zope.location.interfaces import ILocationInfo, IRoot
+from zope.traversing.interfaces import ITraversable, ITraverser
from zope.traversing.adapters import DefaultTraversable
from zope.traversing.adapters import Traverser
from zope.traversing.browser import SiteAbsoluteURL, AbsoluteURL
Modified: zope.traversing/trunk/src/zope/traversing/tests/test_conveniencefunctions.py
===================================================================
--- zope.traversing/trunk/src/zope/traversing/tests/test_conveniencefunctions.py 2009-09-24 09:41:25 UTC (rev 104477)
+++ zope.traversing/trunk/src/zope/traversing/tests/test_conveniencefunctions.py 2009-09-24 11:19:14 UTC (rev 104478)
@@ -21,12 +21,11 @@
from zope.interface import directlyProvides
from zope.location.traversing \
import LocationPhysicallyLocatable, RootPhysicallyLocatable
-from zope.location.interfaces \
- import ILocationInfo, IRoot, LocationError, ITraverser
+from zope.location.interfaces import ILocationInfo, IRoot, LocationError
from zope.security.proxy import Proxy
from zope.security.checker import selectChecker
from zope.traversing.adapters import Traverser, DefaultTraversable
-from zope.traversing.interfaces import ITraversable
+from zope.traversing.interfaces import ITraversable, ITraverser
from zope.app.component.testing import PlacefulSetup
from zope.container.contained import contained
Modified: zope.traversing/trunk/src/zope/traversing/tests/test_traverser.py
===================================================================
--- zope.traversing/trunk/src/zope/traversing/tests/test_traverser.py 2009-09-24 09:41:25 UTC (rev 104477)
+++ zope.traversing/trunk/src/zope/traversing/tests/test_traverser.py 2009-09-24 11:19:14 UTC (rev 104478)
@@ -23,14 +23,14 @@
from zope.location.traversing \
import LocationPhysicallyLocatable, RootPhysicallyLocatable
from zope.location.interfaces \
- import ILocationInfo, IRoot, LocationError, ITraverser
+ import ILocationInfo, IRoot, LocationError
from zope.security.interfaces import Unauthorized
from zope.security.checker \
import ProxyFactory, defineChecker, CheckerPublic, Checker
from zope.security.management import newInteraction, endInteraction
from zope.traversing.adapters import Traverser, DefaultTraversable
-from zope.traversing.interfaces import ITraversable
+from zope.traversing.interfaces import ITraversable, ITraverser
from zope.app.component.testing import PlacefulSetup
from zope.container.contained import Contained, contained
More information about the checkins
mailing list