[Zope3-checkins] CVS: Zope3/src/zope/app/publication - browser.py:1.9.26.1 publicationtraverse.py:1.10.24.1 xmlrpc.py:1.7.8.1 zopepublication.py:1.34.2.1

Jim Fulton jim at zope.com
Mon Sep 8 15:22:15 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	browser.py publicationtraverse.py xmlrpc.py zopepublication.py 
Log Message:
Checking in work in progress on parentgeddon-branch so Fred can help
me to get the tests passing.  Specific log entries will be provided
when we merge this into the head.


=== Zope3/src/zope/app/publication/browser.py 1.9 => 1.9.26.1 ===
--- Zope3/src/zope/app/publication/browser.py:1.9	Sun Jun  1 11:59:34 2003
+++ Zope3/src/zope/app/publication/browser.py	Mon Sep  8 14:21:44 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,13 @@
         r = ()
 
         if IBrowserPublisher.isImplementedBy(removeAllProxies(ob)):
-            r = ob.browserDefault(request)
+            return ob.browserDefault(request)
         else:
             adapter = queryView(ob, '_traverse', request , None)
             if adapter is not None:
-                r = adapter.browserDefault(request)
+                return adapter.browserDefault(request)
             else:
                 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)


=== Zope3/src/zope/app/publication/publicationtraverse.py 1.10 => 1.10.24.1 ===
--- Zope3/src/zope/app/publication/publicationtraverse.py:1.10	Fri Jun 20 02:45:08 2003
+++ Zope3/src/zope/app/publication/publicationtraverse.py	Mon Sep  8 14:21:44 2003
@@ -19,7 +19,6 @@
 from zope.component import queryView
 from zope.publisher.interfaces import NotFound
 from types import StringTypes
-from zope.app.context import ContextWrapper
 from zope.security.checker import ProxyFactory
 
 from zope.proxy import removeAllProxies
@@ -80,7 +79,7 @@
             else:
                 raise NotFound(ob, name, request)
 
-        return ProxyFactory(ContextWrapper(ob2, ob, name=name))
+        return ProxyFactory(ob2)
 
 class PublicationTraverser(PublicationTraverse):
 


=== Zope3/src/zope/app/publication/xmlrpc.py 1.7 => 1.7.8.1 ===
--- Zope3/src/zope/app/publication/xmlrpc.py:1.7	Mon Aug  4 19:19:04 2003
+++ Zope3/src/zope/app/publication/xmlrpc.py	Mon Sep  8 14:21:44 2003
@@ -17,7 +17,6 @@
 
 $Id$
 """
-from zope.app.context import ContextWrapper
 from zope.app.publication.zopepublication import ZopePublication
 from zope.component import queryView, queryDefaultViewName
 from zope.proxy import removeAllProxies
@@ -55,15 +54,15 @@
             view_name = view_name[2:]
 
         # If ob is a presentation object, then we just get the method
-        if IXMLRPCPresentation.isImplementedBy(naked_ob) and \
-               hasattr(ob, view_name):
-            return ProxyFactory(
-                ContextWrapper(getattr(ob, view_name), ob, name=view_name))
+        if (IXMLRPCPresentation.isImplementedBy(naked_ob) and 
+            hasattr(ob, view_name)
+            ):
+            return ProxyFactory(getattr(ob, view_name))
 
         # Let's check whether name could be a view 
         view = queryView(ob, view_name, request)
         if view is not None:
-            return ProxyFactory(ContextWrapper(view, ob, name=view_name))
+            return ProxyFactory(view)
 
         # Now let's see whether we have a default view with a matching method
         # name
@@ -72,8 +71,7 @@
         if defaultName is not None:
             view = queryView(ob, defaultName, request, object)
             if hasattr(view, view_name):
-                return ProxyFactory(ContextWrapper(getattr(view, view_name), ob,
-                                                   name=view_name))
+                return ProxyFactory(getattr(view, view_name))
 
         # See whether we have a subobject
         return super(XMLRPCPublication, self).traverseName(request, ob, name)


=== Zope3/src/zope/app/publication/zopepublication.py 1.34 => 1.34.2.1 ===
--- Zope3/src/zope/app/publication/zopepublication.py:1.34	Tue Sep  2 16:46:48 2003
+++ Zope3/src/zope/app/publication/zopepublication.py	Mon Sep  8 14:21:44 2003
@@ -26,8 +26,6 @@
 from zope.security.management import newSecurityManager
 from zope.security.checker import ProxyFactory
 
-from zope.app.context import ContextWrapper
-
 from zope.proxy import removeAllProxies
 
 from zope.app.interfaces.services.service import ISite
@@ -44,8 +42,6 @@
 
 from zope.app.publication.publicationtraverse import PublicationTraverse
 
-from zope.app.context import ContextWrapper
-
 # XXX Should this be imported here?
 from transaction import get_transaction
 
@@ -75,7 +71,7 @@
             if p is None:
                 raise Unauthorized # If there's no default principal
 
-        request.setUser(ContextWrapper(p, prin_reg))
+        request.setUser(p)
         newSecurityManager(request.user)
         get_transaction().begin()
 
@@ -90,8 +86,7 @@
             return
 
         sm = removeAllProxies(ob).getSiteManager()
-        sm = ContextWrapper(sm, ob, name="++etc++site")
-
+        
         auth_service = sm.queryService(Authentication)
         if auth_service is None:
             # No auth service here
@@ -105,7 +100,7 @@
                 # nothing to do here
                 return
 
-        request.setUser(ContextWrapper(principal, auth_service))
+        request.setUser(principal)
         newSecurityManager(request.user)
 
 
@@ -149,7 +144,7 @@
         if app is None:
             raise SystemError, "Zope Application Not Found"
 
-        return ProxyFactory(ContextWrapper(app, None))
+        return ProxyFactory(app)
 
     def callObject(self, request, ob):
         return mapply(ob, request.getPositionalArguments(), request)
@@ -233,10 +228,10 @@
                 request, 'application error-handling')
             view = None
             try:
-                exception = ContextWrapper(exc_info[1], object)
-                name = queryDefaultViewName(exception, request)
+                exception = exc_info[1]
+                name = queryDefaultViewName(exception, request, context=object)
                 if name is not None:
-                    view = queryView(exception, name, request)
+                    view = queryView(exception, name, request, context=object)
             except:
                 # Problem getting a view for this exception. Log an error.
                 tryToLogException(




More information about the Zope3-Checkins mailing list