[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/traversing - __init__.py:1.2 containmentroot.py:1.2 namespacehandler.py:1.2 objectname.py:1.2 physicallylocatable.py:1.2 traversable.py:1.2 traverser.py:1.2
Jim Fulton
jim@zope.com
Wed, 25 Dec 2002 09:14:06 -0500
Update of /cvs-repository/Zope3/src/zope/app/interfaces/traversing
In directory cvs.zope.org:/tmp/cvs-serv15352/src/zope/app/interfaces/traversing
Added Files:
__init__.py containmentroot.py namespacehandler.py
objectname.py physicallylocatable.py traversable.py
traverser.py
Log Message:
Grand renaming:
- Renamed most files (especially python modules) to lower case.
- Moved views and interfaces into separate hierarchies within each
project, where each top-level directory under the zope package
is a separate project.
- Moved everything to src from lib/python.
lib/python will eventually go away. I need access to the cvs
repository to make this happen, however.
There are probably some bits that are broken. All tests pass
and zope runs, but I haven't tried everything. There are a number
of cleanups I'll work on tomorrow.
=== Zope3/src/zope/app/interfaces/traversing/__init__.py 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:05 2002
+++ Zope3/src/zope/app/interfaces/traversing/__init__.py Wed Dec 25 09:13:04 2002
@@ -0,0 +1,2 @@
+#
+# This file is necessary to make this directory a package.
=== Zope3/src/zope/app/interfaces/traversing/containmentroot.py 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:05 2002
+++ Zope3/src/zope/app/interfaces/traversing/containmentroot.py Wed Dec 25 09:13:04 2002
@@ -0,0 +1,24 @@
+##############################################################################
+#
+# 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$
+"""
+
+from zope.interface import Interface
+
+class IContainmentRoot(Interface):
+ """Marker interface to designate root objects
+ """
+
+__doc__ = IContainmentRoot.__doc__ + __doc__
=== Zope3/src/zope/app/interfaces/traversing/namespacehandler.py 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:05 2002
+++ Zope3/src/zope/app/interfaces/traversing/namespacehandler.py Wed Dec 25 09:13:04 2002
@@ -0,0 +1,34 @@
+##############################################################################
+#
+# 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$
+"""
+
+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.
+ """
=== Zope3/src/zope/app/interfaces/traversing/objectname.py 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:05 2002
+++ Zope3/src/zope/app/interfaces/traversing/objectname.py Wed Dec 25 09:13:04 2002
@@ -0,0 +1,33 @@
+##############################################################################
+#
+# 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
+#
+##############################################################################
+"""
+
+Revision information:
+$Id$
+"""
+from zope.interface import Interface
+
+class IObjectName(Interface):
+
+ def __str__():
+ """Get a human-readable string representation
+ """
+
+ def __repr__():
+ """Get a string representation
+ """
+
+ def __call__():
+ """Get a string representation
+ """
=== Zope3/src/zope/app/interfaces/traversing/physicallylocatable.py 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:05 2002
+++ Zope3/src/zope/app/interfaces/traversing/physicallylocatable.py Wed Dec 25 09:13:04 2002
@@ -0,0 +1,32 @@
+##############################################################################
+#
+# 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$
+"""
+
+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__
=== Zope3/src/zope/app/interfaces/traversing/traversable.py 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:05 2002
+++ Zope3/src/zope/app/interfaces/traversing/traversable.py Wed Dec 25 09:13:04 2002
@@ -0,0 +1,32 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+from zope.interface import Interface
+
+class ITraversable(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
+ 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.
+
+ """
=== Zope3/src/zope/app/interfaces/traversing/traverser.py 1.1 => 1.2 ===
--- /dev/null Wed Dec 25 09:14:06 2002
+++ Zope3/src/zope/app/interfaces/traversing/traverser.py Wed Dec 25 09:13:04 2002
@@ -0,0 +1,38 @@
+##############################################################################
+#
+# 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$
+"""
+
+from zope.interface import Interface
+
+_RAISE_KEYERROR = object()
+
+class ITraverser(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.
+ """