zope.traversing¶
This package provides adapters for resolving object paths by traversing
an object hierarchy. This package also includes support for traversal
namespaces (e.g. ++view++
, ++skin++
, etc.) as well as computing
URLs via the @@absolute_url
view.
Documentation is hosted at https://zopetraversing.readthedocs.io/
API Documentation:
Interfaces¶
Interfaces to do with traversing.
-
interface
zope.traversing.interfaces.
ITraversable
[source]¶ To traverse an object, this interface must be provided
-
traverse
(name, furtherPath)¶ Get the next item on the path
Should return the item corresponding to ‘name’ or raise
LocationError
where appropriate.Parameters:
-
-
interface
zope.traversing.interfaces.
ITraverser
[source]¶ Provide traverse features
-
traverse
(path, default=<object object at 0x7fe4c82db090>)¶ 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.
-
-
interface
zope.traversing.interfaces.
ITraversalAPI
[source]¶ Common API functions to ease traversal computations.
This is provided by
zope.traversing.api
.-
joinPath
(path, *args)¶ Join the given relative paths to the given path.
Returns a text (
unicode
) path.The path should be well-formed, and not end in a ‘/’ unless it is the root path. It can be either a string (ascii only) or unicode. The positional arguments are relative paths to be added to the path as new path segments. The path may be absolute or relative.
A segment may not start with a ‘/’ because that would be confused with an absolute path. A segment may not end with a ‘/’ because we do not allow ‘/’ at the end of relative paths. A segment may consist of ‘.’ or ‘..’ to mean “the same place”, or “the parent path” respectively. A ‘.’ should be removed and a ‘..’ should cause the segment to the left to be removed.
joinPath('/', '..')
should raise an exception.
-
getPath
(obj)¶ Returns a string representing the physical path to the object.
-
getRoot
(obj)¶ Returns the root of the traversal for the given object.
-
traverse
(object, path, default=None, request=None)¶ Traverse path relative to the given object.
Parameters: - path (str) – a string with path segments separated by ‘/’.
- request – Passed in when traversing from presentation code. This allows paths like “@@foo” to work.
Raises: zope.location.interfaces.LocationError – if path cannot be found
Note
Calling
traverse
with a path argument taken from an untrusted source, such as an HTTP request form variable, is a bad idea. It could allow a maliciously constructed request to call code unexpectedly. Consider usingtraverseName
instead.
-
traverseName
(obj, name, default=None, traversable=None, request=None)¶ Traverse a single step name relative to the given object.
name must be a string. ‘.’ and ‘..’ are treated specially, as well as names starting with ‘@’ or ‘+’. Otherwise name will be treated as a single path segment.
You can explicitly pass in an
ITraversable
as the traversable argument. If you do not, the given object will be adapted toITraversable
.request is passed in when traversing from presentation code. This allows paths like “@@foo” to work.
Raises: zope.location.interfaces.LocationError – if path cannot be found and default was not provided.
-
getName
(obj)¶ Get the name an object was traversed via.
-
getParent
(obj)¶ Returns the container the object was traversed via.
Returns
None
if the object is a containment root.Raises: TypeError – if the object doesn’t have enough context to get the parent.
-
getParents
(obj)¶ Returns a list starting with the given object’s parent followed by each of its parents.
Raises: TypeError – if the context doesn’t go all the way down to a containment root.
-
canonicalPath
(path_or_object)¶ Returns a canonical absolute unicode path for the path or object.
Resolves segments that are ‘.’ or ‘..’.
Raises: ValueError – if a badly formed path is given.
-
-
interface
zope.traversing.interfaces.
IPathAdapter
[source]¶ Marker interface for adapters to be used in paths.
See also
-
interface
zope.traversing.interfaces.
IEtcNamespace
[source]¶ Marker for utility registrations in the
++etc++
namespace.See also
-
interface
zope.traversing.interfaces.
IBeforeTraverseEvent
[source]¶ Extends:
zope.interface.interfaces.IObjectEvent
An event which gets sent on publication traverse.
-
request
¶ The current request
-
-
class
zope.traversing.interfaces.
BeforeTraverseEvent
(ob, request)[source]¶ Bases:
zope.interface.interfaces.ObjectEvent
An event which gets sent on publication traverse.
Default implementation of
IBeforeTraverseEvent
.
Traversal Convenience API¶
Convenience functions for traversing the object tree.
This module provides zope.traversing.interfaces.ITraversalAPI
-
zope.traversing.api.
joinPath
(path, *args)[source]¶ Join the given relative paths to the given path.
Returns a text (
unicode
) path.The path should be well-formed, and not end in a ‘/’ unless it is the root path. It can be either a string (ascii only) or unicode. The positional arguments are relative paths to be added to the path as new path segments. The path may be absolute or relative.
A segment may not start with a ‘/’ because that would be confused with an absolute path. A segment may not end with a ‘/’ because we do not allow ‘/’ at the end of relative paths. A segment may consist of ‘.’ or ‘..’ to mean “the same place”, or “the parent path” respectively. A ‘.’ should be removed and a ‘..’ should cause the segment to the left to be removed.
joinPath('/', '..')
should raise an exception.
-
zope.traversing.api.
getPath
(obj)[source]¶ Returns a string representing the physical path to the object.
-
zope.traversing.api.
traverse
(object, path, default=<object object>, request=None)[source]¶ Traverse path relative to the given object.
Parameters: - path (str) – a string with path segments separated by ‘/’.
- request – Passed in when traversing from presentation code. This allows paths like “@@foo” to work.
Raises: zope.location.interfaces.LocationError – if path cannot be found
Note
Calling
traverse
with a path argument taken from an untrusted source, such as an HTTP request form variable, is a bad idea. It could allow a maliciously constructed request to call code unexpectedly. Consider usingtraverseName
instead.
-
zope.traversing.api.
traverseName
(obj, name, default=<object object>, traversable=None, request=None)[source]¶ Traverse a single step name relative to the given object.
name must be a string. ‘.’ and ‘..’ are treated specially, as well as names starting with ‘@’ or ‘+’. Otherwise name will be treated as a single path segment.
You can explicitly pass in an
ITraversable
as the traversable argument. If you do not, the given object will be adapted toITraversable
.request is passed in when traversing from presentation code. This allows paths like “@@foo” to work.
Raises: zope.location.interfaces.LocationError – if path cannot be found and default was not provided.
-
zope.traversing.api.
getParent
(obj)[source]¶ Returns the container the object was traversed via.
Returns
None
if the object is a containment root.Raises: TypeError – if the object doesn’t have enough context to get the parent.
-
zope.traversing.api.
getParents
(obj)[source]¶ Returns a list starting with the given object’s parent followed by each of its parents.
Raises: TypeError – if the context doesn’t go all the way down to a containment root.
-
zope.traversing.api.
canonicalPath
(path_or_object)[source]¶ Returns a canonical absolute unicode path for the path or object.
Resolves segments that are ‘.’ or ‘..’.
Raises: ValueError – if a badly formed path is given.
Traversal Adapters¶
Adapters for the traversing mechanism.
-
class
zope.traversing.adapters.
DefaultTraversable
(subject)[source]¶ Bases:
object
Traverses objects via attribute and item lookup.
Implements
ITraversable
.
-
class
zope.traversing.adapters.
Traverser
(wrapper)[source]¶ Bases:
object
Provide traverse features.
Implements
ITraverser
.
-
zope.traversing.adapters.
traversePathElement
(obj, name, further_path, default=<object object>, traversable=None, request=None)[source]¶ Traverse a single step name relative to the given object.
This is used to implement
zope.traversing.interfaces.ITraversalAPI.traverseName()
.Parameters: - name (str) – must be a string. ‘.’ and ‘..’ are treated specially, as well as names starting with ‘@’ or ‘+’. Otherwise name will be treated as a single path segment.
- further_path (list) – a list of names still to be traversed. This method is allowed to change the contents of further_path.
- traversable (ITraversable) – You can explicitly pass in
an
ITraversable
as the traversable argument. If you do not, the given object will be adapted toITraversable
. - request – assed in when traversing from presentation
code. This allows paths like
@@foo
to work.
Raises: zope.location.interfaces.LocationError – if path cannot be found and ‘default was not provided.
Namespaces¶
URL Namespace Implementations
URL namespaces are an extensible mechanism to provide additional
control over traversal (for example, disambiguating item
versus attribute
access) or access to an
additional set of traversable names (such as registered views
or path adapters
). This mechanism is used
for path segments that look like ++ns++name
. (It is also used for
segments like @@name
, which is a shortcut for ++view++name
.
See nsParse()
for details.)
ns
is the name of the namespace (a named, registered adapter that
implements ITraversable
) and name
is the name to traverse to in
that namespace.
The function namespaceLookup()
handles this process.
If you configure this package by loading its configure.zcml
using
zope.configuration.xmlconfig
, several namespaces are
registered. They are registered both as single adapters for any
object, and as multi-adapters (views) for any object together with a
zope.publisher.interfaces.IRequest
. Those namespaces are:
- etc
- Implemented in
etc
- attribute
- Implemented in
attr
- adapter
- Implemented in
adapter
- item
- Implemented in
item
- acquire
- Implemented in
acquire
- view
- Implemented in
view
- resource
- Implemented in
resource
- lang
- Implemented in
lang
- skin
- Implemented in
skin
- vh
- Implemented in
vh
- debug
- Implemented in
debug
(only if the ZCML featuredevmode
is enabled) and only registered as a multi-adapter.
-
exception
zope.traversing.namespace.
UnexpectedParameters
[source]¶ Bases:
zope.location.interfaces.LocationError
Unexpected namespace parameters were provided.
-
exception
zope.traversing.namespace.
ExcessiveDepth
[source]¶ Bases:
zope.location.interfaces.LocationError
Too many levels of containment. We don’t believe them.
-
zope.traversing.namespace.
namespaceLookup
(ns, name, object, request=None)[source]¶ Lookup a value from a namespace.
We look up a value by getting an adapter from the object to
ITraversable
named ns. If the request is passed, we get a multi-adapter on the object and request (sometimes this is called a “view”).Let’s start with adapter-based traversal:
>>> class I(zope.interface.Interface): ... 'Test interface' >>> @zope.interface.implementer(I) ... class C(object): ... pass
We’ll register a simple testing adapter:
>>> class Adapter(object): ... def __init__(self, context): ... self.context = context ... def traverse(self, name, remaining): ... return name+'42' >>> zope.component.provideAdapter(Adapter, (I,), ITraversable, 'foo')
Then given an object, we can traverse it with a namespace-qualified name:
>>> namespaceLookup('foo', 'bar', C()) 'bar42'
If we give an invalid namespace, we’ll get a not found error:
>>> namespaceLookup('fiz', 'bar', C()) Traceback (most recent call last): ... LocationError: (<zope.traversing.namespace.C object at 0x...>, '++fiz++bar')
We’ll get the same thing if we provide a request:
>>> from zope.publisher.browser import TestRequest >>> request = TestRequest() >>> namespaceLookup('foo', 'bar', C(), request) Traceback (most recent call last): ... LocationError: (<zope.traversing.namespace.C object at 0x...>, '++foo++bar')
We need to provide a view:
>>> class View(object): ... def __init__(self, context, request): ... pass ... def traverse(self, name, remaining): ... return name+'fromview' >>> from zope.traversing.testing import browserView >>> browserView(I, 'foo', View, providing=ITraversable) >>> namespaceLookup('foo', 'bar', C(), request) 'barfromview'
Clean up:
>>> from zope.testing.cleanup import cleanUp >>> cleanUp()
-
zope.traversing.namespace.
nsParse
(name)[source]¶ Parse a namespace-qualified name into a namespace name and a name. Returns the namespace name and a name.
A namespace-qualified name is usually of the form ++ns++name, as in:
>>> nsParse('++acquire++foo') ('acquire', 'foo')
The part inside the +s must be an identifier, so:
>>> nsParse('++hello world++foo') ('', '++hello world++foo') >>> nsParse('+++acquire+++foo') ('', '+++acquire+++foo')
But it may also be a @@foo, which implies the view namespace:
>>> nsParse('@@foo') ('view', 'foo') >>> nsParse('@@@foo') ('view', '@foo') >>> nsParse('@foo') ('', '@foo')
-
class
zope.traversing.namespace.
acquire
(context, request=None)[source]¶ Bases:
zope.traversing.namespace.SimpleHandler
Traversal adapter for the
acquire
namespace.This namespace tries to traverse to the given name starting with the context object. If it cannot be found, it proceeds to look at each
__parent__
all the way up the tree until it is found.It ignores its second constructor arg and stores the first one in its
context
attr.-
traverse
(name, remaining)[source]¶ Acquire a name
Let’s set up some example data:
>>> @zope.interface.implementer(ITraversable) ... class testcontent(object): ... def traverse(self, name, remaining): ... v = getattr(self, name, None) ... if v is None: ... raise LocationError(self, name) ... return v ... def __repr__(self): ... return 'splat' >>> ob = testcontent() >>> ob.a = 1 >>> ob.__parent__ = testcontent() >>> ob.__parent__.b = 2 >>> ob.__parent__.__parent__ = testcontent() >>> ob.__parent__.__parent__.c = 3
And acquire some names:
>>> adapter = acquire(ob)
>>> adapter.traverse('a', ()) 1
>>> adapter.traverse('b', ()) 2
>>> adapter.traverse('c', ()) 3
>>> adapter.traverse('d', ()) Traceback (most recent call last): ... LocationError: (splat, 'd')
-
-
class
zope.traversing.namespace.
attr
(context, request=None)[source]¶ Bases:
zope.traversing.namespace.SimpleHandler
Traversal adapter for the
attribute
namespace.This namespace simply looks for an attribute of the given name.
It ignores its second constructor arg and stores the first one in its
context
attr.
-
class
zope.traversing.namespace.
item
(context, request=None)[source]¶ Bases:
zope.traversing.namespace.SimpleHandler
Traversal adapter for the
item
namespace.This namespace simply uses
__getitem__
to find a value of the given name.It ignores its second constructor arg and stores the first one in its
context
attr.
-
class
zope.traversing.namespace.
etc
(context, request=None)[source]¶ Bases:
zope.traversing.namespace.SimpleHandler
Traversal adapter for the
etc
namespace.This namespace provides for a layer of indirection. The given name is used to find a utility of that name that implements
zope.traversing.interfaces.IEtcNamespace
.As a special case, if there is no such utility, and the name is “site”, then we will attempt to call a method named
getSiteManager
on the context object.It ignores its second constructor arg and stores the first one in its
context
attr.
-
class
zope.traversing.namespace.
view
(context, request)[source]¶ Bases:
object
Traversal adapter for the
view
(@@
) namespace.This looks for the default multi-adapter from the context and request of the given name.
Raises: zope.location.interfaces.LocationError – If no such adapter can be found.
-
class
zope.traversing.namespace.
resource
(context, request)[source]¶ Bases:
zope.traversing.namespace.view
Traversal adapter for the
resource
namespace.Resources are default adapters of the given name for the request (not the context). The returned object will have its
__parent__
set to the context and its__name__
will match the name we traversed.
-
class
zope.traversing.namespace.
lang
(context, request)[source]¶ Bases:
zope.traversing.namespace.view
Traversal adapter for the
lang
namespace.Traversing to name means to adapt the request to
zope.i18n.interfaces.IModifiableUserPreferredLanguages
and set the name as the only preferred language.This needs the request to support
zope.publisher.interfaces.http.IVirtualHostRequest
because it shifts the language name to the application.
-
class
zope.traversing.namespace.
skin
(context, request)[source]¶ Bases:
zope.traversing.namespace.view
Traversal adapter for the
skin
namespace.Traversing to name looks for the
zope.publisher.interfaces.browser.IBrowserSkinType
utility having the given name, and then applies it to the request withapplySkin()
.This needs the request to support
zope.publisher.interfaces.http.IVirtualHostRequest
because it shifts the skin name to the application.
-
class
zope.traversing.namespace.
vh
(context, request)[source]¶ Bases:
zope.traversing.namespace.view
Traversal adapter for the
vh
namespace.Traversing to name, which must be of the form
protocol:host:port
causes a call tozope.publisher.interfaces.http.IVirtualHostRequest.setApplicationServer()
. Segments in the request’s traversal stack up to a prior++
are collected and become the application names given tozope.publisher.interfaces.http.IVirtualHostRequest.setVirtualHostRoot()
.
-
class
zope.traversing.namespace.
adapter
(context, request=None)[source]¶ Bases:
zope.traversing.namespace.SimpleHandler
Traversal adapter for the
adapter
namespace.This adapter provides traversal to named adapters for the context registered to provide
zope.traversing.interfaces.IPathAdapter
.It ignores its second constructor arg and stores the first one in its
context
attr.-
traverse
(name, ignored)[source]¶ To demonstrate this, we need to register some adapters:
>>> def adapter1(ob): ... return 1 >>> def adapter2(ob): ... return 2 >>> zope.component.provideAdapter( ... adapter1, (None,), IPathAdapter, 'a1') >>> zope.component.provideAdapter( ... adapter2, (None,), IPathAdapter, 'a2')
Now, with these adapters in place, we can use the traversal adapter:
>>> ob = object() >>> adapter = adapter(ob) >>> adapter.traverse('a1', ()) 1 >>> adapter.traverse('a2', ()) 2 >>> try: ... adapter.traverse('bob', ()) ... except LocationError: ... print('no adapter') no adapter
Clean up:
>>> from zope.testing.cleanup import cleanUp >>> cleanUp()
-
-
class
zope.traversing.namespace.
debug
(context, request)[source]¶ Bases:
zope.traversing.namespace.view
Traversal adapter for the
debug
namespace.This adapter allows debugging flags to be set in the request.
See also
zope.publisher.interfaces.IDebugFlags
-
traverse
(name, ignored)[source]¶ Setup for demonstration:
>>> from zope.publisher.browser import TestRequest >>> request = TestRequest() >>> ob = object() >>> adapter = debug(ob, request)
in debug mode,
++debug++source
enables source annotations>>> request.debug.sourceAnnotations False >>> adapter.traverse('source', ()) is ob True >>> request.debug.sourceAnnotations True
++debug++tal
enables TAL markup in output>>> request.debug.showTAL False >>> adapter.traverse('tal', ()) is ob True >>> request.debug.showTAL True
++debug++errors
enables tracebacks (by switching to debug skin)>>> from zope.publisher.interfaces.browser import IBrowserRequest >>> from zope.interface import directlyProvides >>> from zope.interface import Interface >>> class Debug(IBrowserRequest): ... pass >>> directlyProvides(Debug, IBrowserSkinType) >>> zope.component.provideUtility( ... Debug, IBrowserSkinType, name='Debug')
>>> Debug.providedBy(request) False >>> adapter.traverse('errors', ()) is ob True >>> Debug.providedBy(request) True
Interfaces already directly provided by the request are still provided by it once the debug skin is applied.
>>> request = TestRequest() >>> class IFoo(Interface): ... pass >>> directlyProvides(request, IFoo) >>> adapter = debug(ob, request) >>> adapter.traverse('errors', ()) is ob True >>> Debug.providedBy(request) True >>> IFoo.providedBy(request) True
You can specify several flags separated by commas
>>> adapter.traverse('source,tal', ()) is ob True
Unknown flag names cause exceptions
>>> try: ... adapter.traverse('badflag', ()) ... except ValueError: ... print('unknown debugging flag') unknown debugging flag
Of course, if Python was started with the
-O
flag to disable debugging, none of this is allowed (we simulate this with a private setting on the instance):>>> adapter.enable_debug = False >>> adapter.traverse('source', ()) Traceback (most recent call last): ... ValueError: Debug flags only allowed in debug mode
-
Publication Traverser¶
Publication Traverser
-
class
zope.traversing.publicationtraverse.
PublicationTraverser
[source]¶ Bases:
object
Traversal used for publication.
The significant differences from
zope.traversing.adapters.traversePathElement
are:- Instead of adapting each traversed object to ITraversable,
this version multi-adapts (ob, request) to
zope.publisher.interfaces.IPublishTraverse
. - This version wraps a security proxy around each traversed object.
- This version raises
zope.publisher.interfaces.NotFound
rather thanzope.location.interfaces.LocationError
. - This version has a method,
traverseRelativeURL()
, that supports “browserDefault” traversal.
- Instead of adapting each traversed object to ITraversable,
this version multi-adapts (ob, request) to
-
zope.traversing.publicationtraverse.
PublicationTraverse
¶ alias of
zope.traversing.publicationtraverse.PublicationTraverser
-
class
zope.traversing.publicationtraverse.
PublicationTraverserWithoutProxy
[source]¶ Bases:
zope.traversing.publicationtraverse.PublicationTraverser
A
PublicationTraverse
that does not add security proxies.
Browser Documentation:
Browser Interfaces¶
Browser traversal interfaces
-
interface
zope.traversing.browser.interfaces.
IAbsoluteURL
[source]¶ An absolute URL.
These are typically registered as adapters or multi-adapters for objects.
-
__unicode__
()¶ Returns the URL as a unicode string.
-
__str__
()¶ Returns an ASCII string with all unicode characters url quoted.
-
__repr__
()¶ Get a string representation
-
__call__
()¶ Returns an ASCII string with all unicode characters url quoted.
Returns a tuple like ({‘name’:name, ‘url’:url}, …)
Name is the name to display for that segment of the breadcrumbs. URL is the link for that segment of the breadcrumbs.
-
-
interface
zope.traversing.browser.interfaces.
IAbsoluteURLAPI
[source]¶ The API to compute absolute URLs of objects.
Provided by
zope.traversing.browser.absoluteurl
-
absoluteURL
(ob, request)¶ Compute the absolute URL of an object.
This should return an ASCII string by looking up an adapter from
(ob, request)
toIAbsoluteURL
and then calling it.
-
Browser Absolute URLs¶
Absolute URL View components.
These are registered as views and named views (absolute_url
) if
you load this package’s configure.zcml
with
zope.configuration.xmlconfig
.
-
class
zope.traversing.browser.absoluteurl.
AbsoluteURL
(context, request)[source]¶ Bases:
zope.traversing.browser.absoluteurl._EncodedUnicode
,zope.publisher.browser.BrowserView
The default implementation of
zope.traversing.browser.interfaces.IAbsoluteURL
.
-
class
zope.traversing.browser.absoluteurl.
SiteAbsoluteURL
(context, request)[source]¶ Bases:
zope.traversing.browser.absoluteurl._EncodedUnicode
,zope.publisher.browser.BrowserView
An implementation of
zope.traversing.browser.interfaces.IAbsoluteURL
for site root objects (zope.location.interfaces.IRoot
).
Changes¶
4.4.1 (2020-03-31)¶
- Ensure all objects have consistent resolution orders. Previously, the “debug” namespace’s “errors” flag completely changed the resolution order of the request instead of simply adding the “Debug” skin.
4.4.0 (2020-03-30)¶
- Drop support for Python 3.4.
- Add support for Python 3.8.
4.3.1 (2018-10-16)¶
- Fix DeprecationWarnings for
ComponentLookupError
by importing them fromzope.interface.interfaces
. See issue 10.
4.3 (2018-10-05)¶
- Add support for Python 3.7.
- Host documentation at https://zopetraversing.readthedocs.io
4.2.0 (2017-09-23)¶
- Add support for Python 3.6.
- Drop support for Python 3.3.
- Drop support for
python setup.py test
.
4.1.0 (2016-08-05)¶
- Add support for Python 3.5.
- Drop support for Python 2.6.
- Gracefully handle
UnicodeEncodeError
that can be produced when doing attribute lookup on Python 2 by instead raising aLocationError
.
4.0.0 (2014-03-21)¶
- Add support for Python 3.4.
4.0.0a3 (2013-03-12)¶
- Add support for PyPy.
4.0.0a2 (2013-02-21)¶
- Remove
zope.container
testing dependency to break another circular dependency. - Remove
zope.pagetemplate
testing dependency to break another circular dependency. - Remove
zope.browserpage
(ZCML) dependency by using low-level directives. - Remove
zope.site
testing dependency.
4.0.0a1 (2013-02-20)¶
- Replace deprecated
zope.component.adapts
usage with equivalentzope.component.adapter
decorator. - Replace deprecated
zope.interface.implements
usage with equivalentzope.interface.implementer
decorator. - Drop support for Python 2.4 and 2.5.
- Add support for Python 3.3.
- Fix dependencies : removed
zope.tal
and addedzope.browserpage
.
3.14.0 (2011-03-02)¶
- Re-release of 3.13.1 as a feature version as it introduces dependencies on new feature releases.
3.13.1 (2010-12-14)¶
- Fix ZCML-related dependencies.
3.13 (2010-07-09)¶
When a
__parent__
attribute is available on an object, it is always used for absolute URL construction, and no ILocation adapter lookup is performed for it. This was the previous behavior but was broken (around 3.5?) due to dependency refactoring.If the object provides no
__parent__
then an ILocation adapter lookup will be performed. This will always succeed as zope.location provides a default LocationProxy for everything, but more specific ILocation adapters can also be provided.
3.12.1 (2010-04-30)¶
- Remove use of
zope.testing.doctestunit
in favor of stdlib’s doctest.
3.12.0 (2009-12-29)¶
- Avoid testing dependencies on
zope.securitypolicies
andzope.principalregistry
.
3.11.0 (2009-12-27)¶
- Remove testing dependency on
zope.app.publication
.
3.10.0 (2009-12-16)¶
- Remove stray test claiming a no longer existing dependency on
zope.app.applicationcontrol
. - Refactor functional tests to loose dependency on both
zope.app.appsetup
andzope.app.testing
. - Simplify tests for the
browser
sub-package by usingPlacelessSetup
fromzope.component.testing
instead ofzope.app.testing
. - Simplify
test_dependencies
module by usingzope.configuration
instead ofzope.app.testing.functional
. - Remove testing dependency on
zope.app.publisher
. - Replace testing dependency on
zope.app.security
withzope.securitypolicy
. - Remove testing dependency on
zope.app.zcmlfiles
in favor of more explicit dependencies. - Remove testing dependency on
zope.app.component
. - Replace a test dependency on
zope.app.zptpage
with a dependency onzope.pagetemplate
.
3.9.0 (2009-12-15)¶
- Move
IBeforeTraverseEvent
here fromzope.app.publication
, as we already deal with publication traversal.
3.8.0 (2009-09-29)¶
- In
zope.traversing.api.getParent()
, try to delegate tozope.location.interfaces.ILocationInfo.getParent()
, analogous togetParents()
. Keep returning the traversal parent as a fallback. - Bring
ITraverser
back fromzope.location
where it had been moved to invert the package interdependency, but where it is now no longer used.
3.7.2 (2009-08-29)¶
- Make virtual hosting tests compatible with
zope.publisher
3.9. Redirecting to a different host requires an explicittrusted
redirect now.
3.7.1 (2009-06-16)¶
AbsoluteURL
now implements the fact that__call__
returns the same as__str__
in a manner that it applies for subclasses, too, so they only have to override__str__
and not both.
3.7.0 (2009-05-23)¶
- Move the
publicationtraverse
module tozope.traversing
, removing thezope.app.publisher
->zope.app.publication
dependency (which was a cycle). - Look up the application controller through a utility registration rather than a direct reference.
3.6.0 (2009-04-06)¶
- Change
configure.zcml
not to depend onzope.app.component
. - This release includes the BBB-incompatible
zope.publisher.skinnable
change from 3.5.3.
3.5.4 (2009-04-06)¶
- Revert BBB-incompatible use of
zope.publisher.skinnable
: that change belongs in a 3.6.0 release, because it requires a BBB-incompatible version ofzope.publisher
.
3.5.3 (2009-03-10)¶
- Use applySkin from new location. zope.publisher.skinnable instead of zope.publisher.browser.
- Use IAbsoluteURL lookup instead of the “absolute_url” view in the recursive AbsoluteURL adapters (LP: #338101).
3.5.2 (2009-02-04)¶
RootPhysicallyLocatable
is not the same asLocationPhysicallyLocatable
(now inzope.location
). Fix the import and testing setups.
3.5.1 (2009-02-02)¶
Obsolete the
RootPhysicallyLocatable
adapter, which has been superseded by the refactoredzope.location.traversing.LocationPhysicallyLocatable
that we depend on since 3.5.0a4.Remove the adapter and its registration, and making its import place pointing to
zope.location.traversing.LocationPhysicallyLocatable
to maintain backward-compatibility.This also fixes a bug introduced in version 3.5.0a4 when trying to call
getParents
function for the root object.Use direct imports instead of compatibility ones for things that were moved to
zope.location
.Remove the
zope.traversing.interfaces.INamespaceHandler
interface, as it seems not to be used for years.Change package’s mailing list address to zope-dev at zope.org instead of retired zope3-dev at zope.org
3.5.0 (2009-01-31)¶
- Use zope.container instead of
zope.app.container
. - Use zope.site instead of
zope.app.folder
in the unit tests. - Reduce, but not eliminate, test dependencies on
zope.app.component
.
3.5.0a4 (2008-08-01)¶
- Reverse dependencies between
zope.location
andzope.traversing
. - Update (test) dependencies and tests to expect and work with a spec
compliant TAL interpreter as available in
zope.tal
>= 3.5.0. - Fix deprecation warning caused by using an old module name for
ZopeSecurityPolicy
inftesting.zcml
. - Ensure traversing doesn’t raise an TypeError but a TraversalError when the traversal step before yielded a string.
3.5.0a3 (2007-12-28)¶
- Back out the controversial
++skin++
traverser for XML-RPC.
3.5.0a2 (2007-11-28)¶
- Port 3.4.1a1 to trunk
- Do not use unicode strings to set the application server in the virtual
host namespace. This caused
absolute_url
to create unicode URL’s.
- Do not use unicode strings to set the application server in the virtual
host namespace. This caused
- Add a traverer for
++skin++
for XMLRPC skins (IXMLRPCSkinType
). This also means that the normal++skin++
namespace handler is only bound toIBrowserRequest
. - Resolve the dependency on
zope.app.applicationcontrol
by importing the application controller only if the package is available.
3.4.1 (2008-07-30)¶
- Fix deprecation warning caused by using an old module name for
ZopeSecurityPolicy
inftesting.zcml
.
3.4.1a1 (2007-11-13)¶
- Do not use unicode strings to set the application server in the virtual host namespace. This caused absolute_url to create unicode URL’s.
3.4.0 (2007-09-29)¶
No further changes since 3.4.0a1.
3.4.0a1 (2007-04-22)¶
Initial release as a separate project, corresponds to zope.traversing
from Zope 3.4.0a1