[Zope3-checkins] CVS: Zope3/src/zope/app/traversing - __init__.py:1.14
Sidnei da Silva
sidnei@x3ng.com.br
Sun, 30 Mar 2003 10:36:43 -0500
Update of /cvs-repository/Zope3/src/zope/app/traversing
In directory cvs.zope.org:/tmp/cvs-serv17852/src/zope/app/traversing
Modified Files:
__init__.py
Log Message:
joinPath helper function.
=== Zope3/src/zope/app/traversing/__init__.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/traversing/__init__.py:1.13 Mon Mar 24 11:42:22 2003
+++ Zope3/src/zope/app/traversing/__init__.py Sun Mar 30 10:36:42 2003
@@ -24,6 +24,13 @@
_marker = object()
+def joinPath(path, *args):
+ """Concatenate a path and various args with slashes"""
+ for arg in args:
+ path = path.endswith('/') and '%s%s' % (path, arg) \
+ or '%s/%s' % (path, arg)
+ return path
+
def getPath(obj):
"""Returns a string representing the physical path to the object.
"""