[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/traversing - __init__.py:1.1.2.1 containmentroot.py:1.1.2.1 namespacehandler.py:1.1.2.1 physicallylocatable.py:1.1.2.1 traversable.py:1.1.2.1 traverser.py:1.1.2.1
Jim Fulton
jim@zope.com
Mon, 23 Dec 2002 14:31:56 -0500
Update of /cvs-repository/Zope3/src/zope/app/interfaces/traversing
In directory cvs.zope.org:/tmp/cvs-serv19908/zope/app/interfaces/traversing
Added Files:
Tag: NameGeddon-branch
__init__.py containmentroot.py namespacehandler.py
physicallylocatable.py traversable.py traverser.py
Log Message:
Initial renaming before debugging
=== Added File Zope3/src/zope/app/interfaces/traversing/__init__.py ===
#
# This file is necessary to make this directory a package.
=== Added File Zope3/src/zope/app/interfaces/traversing/containmentroot.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
$Id: containmentroot.py,v 1.1.2.1 2002/12/23 19:31:54 jim Exp $
"""
from zope.interface import Interface
class IContainmentRoot(Interface):
"""Marker interface to designate root objects
"""
__doc__ = IContainmentRoot.__doc__ + __doc__
=== Added File Zope3/src/zope/app/interfaces/traversing/namespacehandler.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
$Id: namespacehandler.py,v 1.1.2.1 2002/12/23 19:31:54 jim Exp $
"""
from zope.interface import Interface
class INamespaceHandler(Interface):
def __call__(name, parameters, pname, object, request):
"""Access a name in a namespace
The name lookup usually depends on an object and/or a
request. If an object or request is unavailable, None will be passed.
The parameters provided, are passed as a sequence of
name, value items. The 'pname' argument has the original name
before parameters were removed.
It is not the respoonsibility of the handler to wrap the return value.
"""
=== Added File Zope3/src/zope/app/interfaces/traversing/physicallylocatable.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
$Id: physicallylocatable.py,v 1.1.2.1 2002/12/23 19:31:54 jim Exp $
"""
from zope.interface import Interface
class IPhysicallyLocatable(Interface):
"""Objects that have a physical location in a containment hierarchy.
"""
def getPhysicalRoot():
"""Return the physical root object
"""
def getPhysicalPath():
"""Return the physical path to the object as a sequence of names.
"""
__doc__ = IPhysicallyLocatable.__doc__ + __doc__
=== Added File Zope3/src/zope/app/interfaces/traversing/traversable.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import zope.interface
class ITraversable(Interface.Interface):
"""To traverse an object, this interface must be provided"""
def traverse(name, parameters, pname, furtherPath):
"""Get the next item on the path
Should return the item corresponding to 'name' or raise
Zope.Exceptions.NotFoundError where appropriate.
The parameters provided, are passed as a sequence of
name, value items. The 'pname' argument has the original name
before parameters were removed.
furtherPath is a list of names still to be traversed. This method is
allowed to change the contents of furtherPath.
"""
=== Added File Zope3/src/zope/app/interfaces/traversing/traverser.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
$Id: traverser.py,v 1.1.2.1 2002/12/23 19:31:54 jim Exp $
"""
import zope.interface
_RAISE_KEYERROR = object()
class ITraverser(Interface.Interface):
"""Provide traverse features"""
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.
"""