[Zope3-checkins] CVS: Zope3/src/zope/app/publication - browser.py:1.10

Jim Fulton jim at zope.com
Sun Sep 21 13:32:36 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/publication
In directory cvs.zope.org:/tmp/cvs-serv14483/src/zope/app/publication

Modified Files:
	browser.py 
Log Message:
No longer use context wrappers.

Make sure that the result of getDefaultTraversal is proxied.


=== Zope3/src/zope/app/publication/browser.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/publication/browser.py:1.9	Sun Jun  1 11:59:34 2003
+++ Zope3/src/zope/app/publication/browser.py	Sun Sep 21 13:32:36 2003
@@ -21,7 +21,6 @@
      import PublicationTraverser as PublicationTraverser_
 from zope.app.publication.zopepublication import ZopePublication
 from zope.component import queryAdapter, queryView
-from zope.app.context import ContextWrapper
 from zope.proxy import removeAllProxies
 from zope.publisher.interfaces.browser import IBrowserPublisher
 from zope.security.checker import ProxyFactory
@@ -51,19 +50,17 @@
         r = ()
 
         if IBrowserPublisher.isImplementedBy(removeAllProxies(ob)):
-            r = ob.browserDefault(request)
+            # ob is already proxied, so the result of calling a method will be
+            return ob.browserDefault(request)
         else:
             adapter = queryView(ob, '_traverse', request , None)
             if adapter is not None:
-                r = adapter.browserDefault(request)
+                ob, path = adapter.browserDefault(request)
+                ob = ProxyFactory(ob)
+                return ob, path
             else:
+                # ob is already proxied
                 return (ob, None)
-
-        if r[0] is ob:
-            return r
-
-        wrapped = ContextWrapper(ProxyFactory(r[0]), ob, name=None)
-        return (wrapped, r[1])
 
     def afterCall(self, request):
         super(BrowserPublication, self).afterCall(request)




More information about the Zope3-Checkins mailing list