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

Jim Fulton jim at zope.com
Tue Sep 9 12:47:37 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	resource.py 
Log Message:
got more tests to pass

=== Zope3/src/zope/app/publisher/browser/resource.py 1.5.6.1 => 1.5.6.2 ===
--- Zope3/src/zope/app/publisher/browser/resource.py:1.5.6.1	Mon Sep  8 14:21:45 2003
+++ Zope3/src/zope/app/publisher/browser/resource.py	Tue Sep  9 11:47:06 2003
@@ -17,43 +17,23 @@
 """
 __metaclass__ = type # All classes are new style when run with Python 2.2+
 
-from zope.component import queryView
-from zope.app.traversing import joinPath
-from zope.component.interfaces import IResourceService
+from zope.app import zapi
 from zope.app.location import Location
+from zope.app.interfaces.services.service import ISite
 
 class Resource(Location):
 
     def __init__(self, request):
         self.request = request
 
-    def __call__(wrapped_self):
+    def __call__(self):
         name = self.__name__
         if name.startswith('++resource++'):
             name = name[12:]
 
-        service = self.__parent__
-        while not IResourceService.isImplementedBy(service):
-            name = "%s/%s" % (service.__name__, name)
-            service = service.__parent__
+        site = self.__parent__
+        while not ISite.isImplementedBy(site):
+            site = site.__parent__
 
-        site = service.__parent__
-
-        skin = wrapped_self.request.getPresentationSkin()
-        if skin:
-            skin = "++skin++%s" % skin
-
-        base_url = wrapped_self.request.getApplicationURL(path_only=True)
-
-        if site is not None:
-            raise NotImplementedError("This code path is not tested")
-            absolute_url = queryView(service,
-                                     'absolute_url',
-                                     wrapped_self.request)
-            if absolute_url is not None:
-                base_url = absolute_url()
-
-        if skin:
-            return joinPath(base_url, skin, '@@', name) # XXX joinPath should
-        else:                                           # XXX eat empty path
-            return joinPath(base_url, '@@', name)       # XXX elements
+        url = str(zapi.getView(site, 'absolute_url', self.request))
+        return "%s/@@/%s" % (url, name)




More information about the Zope3-Checkins mailing list