[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - resource.py:1.3.12.2

Steve Alexander steve@cat-box.net
Mon, 19 May 2003 10:36:03 -0400


Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv22879/src/zope/app/publisher/browser

Modified Files:
      Tag: stevea-decorators-branch
	resource.py 
Log Message:
Removed use of joinPath. joinPath should not be used for URLs, it should
be used only for traversal paths.


=== Zope3/src/zope/app/publisher/browser/resource.py 1.3.12.1 => 1.3.12.2 ===
--- Zope3/src/zope/app/publisher/browser/resource.py:1.3.12.1	Mon May 19 10:17:35 2003
+++ Zope3/src/zope/app/publisher/browser/resource.py	Mon May 19 10:36:01 2003
@@ -40,7 +40,7 @@
             skin = "++skin++%s" % skin
 
         # base_url is the Application URL. This is the URL of a site.
-        base_url = wrapped_self.request.getApplicationURL(path_only=True)
+        base_url = wrapped_self.request.getApplicationURL()
 
         if site is not None:
             # XXX This path needs a unit test.
@@ -55,15 +55,10 @@
                 # name of the resource.
                 print absolute_url()
                 return '%s/%s' % (absolute_url(), name)
-                # XXX: need to say
-                #        return joinPath(absolute_url(path_only=True), name)
-                #      But, absolute_url doesn't have a path_only argument.
 
-        # XXX This test would be unnecessary if joinPath were made to eat
-        #     empty path elements.
-        if skin:
-            return joinPath(base_url, skin, '@@', name)
-        else:
-            return joinPath(base_url, '@@', name)
+        return u'/'.join([segment
+                          for segment in (base_url, skin, '@@', name)
+                          if segment
+                          ])
 
     __call__ = ContextMethod(__call__)