[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - resource.py:1.3.12.1
Steve Alexander
steve@cat-box.net
Mon, 19 May 2003 10:17:36 -0400
Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv20285/src/zope/app/publisher/browser
Modified Files:
Tag: stevea-decorators-branch
resource.py
Log Message:
Fixed another test failure.
There are now two functional tests failing; both to do with virtual
hosting. It looks to me like the tests themselves are incorrect, but I'm
not all that sure.
=== Zope3/src/zope/app/publisher/browser/resource.py 1.3 => 1.3.12.1 ===
--- Zope3/src/zope/app/publisher/browser/resource.py:1.3 Tue Apr 15 08:24:33 2003
+++ Zope3/src/zope/app/publisher/browser/resource.py Mon May 19 10:17:35 2003
@@ -39,19 +39,31 @@
if skin:
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)
if site is not None:
- raise NotImplementedError("This code path is not tested")
+ # XXX This path needs a unit test.
+
+ # This is the absolute url of a local resource service.
absolute_url = queryView(service,
'absolute_url',
wrapped_self.request)
if absolute_url is not None:
- base_url = absolute_url()
+ # So, if we have a local resource service, we can return
+ # the path to the local resource service joined with the
+ # 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) # XXX joinPath should
- else: # XXX eat empty path
- return joinPath(base_url, '@@', name) # XXX elements
+ return joinPath(base_url, skin, '@@', name)
+ else:
+ return joinPath(base_url, '@@', name)
__call__ = ContextMethod(__call__)