[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser -
directoryresource.py:1.3 resource.py:1.7
Sidnei da Silva
sidnei at x3ng.com.br
Wed Sep 24 13:22:38 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv9332/src/zope/app/publisher/browser
Modified Files:
directoryresource.py resource.py
Log Message:
Fix directoryResource the same way as other resources, plus make a test for the generated URL and fix Resource.__call__ accordingly.
=== Zope3/src/zope/app/publisher/browser/directoryresource.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/publisher/browser/directoryresource.py:1.2 Mon Sep 22 17:05:13 2003
+++ Zope3/src/zope/app/publisher/browser/directoryresource.py Wed Sep 24 13:22:07 2003
@@ -90,5 +90,6 @@
self.__checker = checker
def __call__(self, request):
- return Proxy(DirectoryResource(self.__dir, request),
- self.__checker)
+ resource = DirectoryResource(self.__dir, request)
+ resource.__Security_checker__ = self.__checker
+ return resource
=== Zope3/src/zope/app/publisher/browser/resource.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/publisher/browser/resource.py:1.6 Sun Sep 21 13:32:40 2003
+++ Zope3/src/zope/app/publisher/browser/resource.py Wed Sep 24 13:22:07 2003
@@ -21,7 +21,7 @@
from zope.app.location import Location
from zope.app.interfaces.services.service import ISite
from zope.app.interfaces.traversing import IContainmentRoot
-
+from zope.component.interfaces import IResourceService
class Resource(Location):
@@ -29,18 +29,24 @@
self.request = request
def __call__(self):
+ names = []
name = self.__name__
if name.startswith('++resource++'):
name = name[12:]
+ names.append(name)
site = self.__parent__
- while 1:
+ while site and 1:
if ISite.isImplementedBy(site):
break
if IContainmentRoot.isImplementedBy(site):
site = None
break
+ if site.__name__:
+ names.append(site.__name__)
site = site.__parent__
+ names.reverse()
+ name = '/'.join(filter(None, names))
url = str(zapi.getView(site, 'absolute_url', self.request))
return "%s/@@/%s" % (url, name)
More information about the Zope3-Checkins
mailing list