[Zope3-checkins] CVS: Zope3/src/zope/app/publication - browser.py:1.6.22.1 httpfactory.py:1.3.12.1 publicationtraverse.py:1.6.10.1 traversers.py:1.4.10.1 xmlrpc.py:1.5.22.1 zopepublication.py:1.27.10.1

Grégoire Weber zope@i-con.ch
Sun, 22 Jun 2003 10:24:19 -0400


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

Modified Files:
      Tag: cw-mail-branch
	browser.py httpfactory.py publicationtraverse.py traversers.py 
	xmlrpc.py zopepublication.py 
Log Message:
Synced up with HEAD

=== Zope3/src/zope/app/publication/browser.py 1.6 => 1.6.22.1 ===
--- Zope3/src/zope/app/publication/browser.py:1.6	Tue Feb 11 10:59:52 2003
+++ Zope3/src/zope/app/publication/browser.py	Sun Jun 22 10:23:18 2003
@@ -21,8 +21,8 @@
      import PublicationTraverser as PublicationTraverser_
 from zope.app.publication.zopepublication import ZopePublication
 from zope.component import queryAdapter, queryView
-from zope.proxy.context import ContextWrapper
-from zope.proxy.introspection import removeAllProxies
+from zope.app.context import ContextWrapper
+from zope.proxy import removeAllProxies
 from zope.publisher.interfaces.browser import IBrowserPublisher
 from zope.security.checker import ProxyFactory
 


=== Zope3/src/zope/app/publication/httpfactory.py 1.3 => 1.3.12.1 ===
--- Zope3/src/zope/app/publication/httpfactory.py:1.3	Fri Apr 18 18:12:27 2003
+++ Zope3/src/zope/app/publication/httpfactory.py	Sun Jun 22 10:23:18 2003
@@ -16,7 +16,7 @@
 $Id$
 """
 
-from zope.interface import moduleProvides
+from zope.interface import moduleProvides, implements
 from zope.publisher.http import HTTPRequest
 from zope.publisher.browser import BrowserRequest
 from zope.publisher.xmlrpc import XMLRPCRequest
@@ -28,7 +28,6 @@
 from zope.app.publication.browser import BrowserPublication
 from zope.app.publication.xmlrpc import XMLRPCPublication
 
-
 moduleProvides(IPublicationRequestFactoryFactory)
 
 __metaclass__ = type
@@ -37,7 +36,7 @@
 
 class HTTPPublicationRequestFactory:
 
-    __implements__ = IPublicationRequestFactory
+    implements(IPublicationRequestFactory)
 
     def __init__(self, db):
         'See IRequestFactory'
@@ -63,7 +62,7 @@
         else:
             request = HTTPRequest(input_stream, output_steam, env)
             request.setPublication(self._http)
-        
+
         return request
 
 realize = HTTPPublicationRequestFactory


=== Zope3/src/zope/app/publication/publicationtraverse.py 1.6 => 1.6.10.1 ===
--- Zope3/src/zope/app/publication/publicationtraverse.py:1.6	Thu May  1 15:35:26 2003
+++ Zope3/src/zope/app/publication/publicationtraverse.py	Sun Jun 22 10:23:18 2003
@@ -19,10 +19,10 @@
 from zope.component import queryView
 from zope.publisher.interfaces import NotFound
 from types import StringTypes
-from zope.proxy.context import ContextWrapper
+from zope.app.context import ContextWrapper
 from zope.security.checker import ProxyFactory
 
-from zope.proxy.introspection import removeAllProxies
+from zope.proxy import removeAllProxies
 from zope.app.traversing.namespace import namespaceLookup
 from zope.app.traversing.namespace import parameterizedNameParse
 from zope.publisher.interfaces import IPublishTraverse
@@ -75,6 +75,8 @@
             adapter = queryView(ob, '_traverse', request, self) # marker
             if adapter is not self:
                 ob2 = adapter.publishTraverse(request, nm)
+                # ob2 will be security proxied here becuase the adapter
+                # was security proxied.
             else:
                 raise NotFound(ob, name, request)
 


=== Zope3/src/zope/app/publication/traversers.py 1.4 => 1.4.10.1 ===
--- Zope3/src/zope/app/publication/traversers.py:1.4	Thu May  1 15:35:26 2003
+++ Zope3/src/zope/app/publication/traversers.py	Sun Jun 22 10:23:18 2003
@@ -15,6 +15,7 @@
 
 __metaclass__ = type
 
+from zope.interface import providedBy, implements
 from zope.publisher.interfaces import Unauthorized, NotFound
 from zope.publisher.interfaces.browser import IBrowserPublisher
 from zope.publisher.interfaces.xmlrpc import IXMLRPCPublisher
@@ -23,7 +24,7 @@
 class SimpleComponentTraverser:
     """Browser traverser for simple components that can only traverse to views
     """
-    __implements__ = IBrowserPublisher, IXMLRPCPublisher
+    implements(IBrowserPublisher, IXMLRPCPublisher)
 
     def __init__(self, context, request):
         self.context = context
@@ -70,7 +71,7 @@
 class TestTraverser:
     "Bobo-style traverser, mostly useful for testing"
 
-    __implements__ = IBrowserPublisher
+    implements(IBrowserPublisher)
 
     def __init__(self, context, request):
         self.context = context
@@ -78,7 +79,7 @@
     def browserDefault(self, request):
         ob = self.context
 
-        if hasattr(ob, '__implements__'):
+        if providedBy(ob):
 
             view_name = getDefaultViewName(ob, request)
 


=== Zope3/src/zope/app/publication/xmlrpc.py 1.5 => 1.5.22.1 ===
--- Zope3/src/zope/app/publication/xmlrpc.py:1.5	Tue Feb 11 10:59:52 2003
+++ Zope3/src/zope/app/publication/xmlrpc.py	Sun Jun 22 10:23:18 2003
@@ -16,7 +16,7 @@
 $Id$
 """
 
-from zope.proxy.introspection import removeAllProxies
+from zope.proxy import removeAllProxies
 from zope.app.publication.zopepublication import ZopePublication
 from zope.component import queryView
 


=== Zope3/src/zope/app/publication/zopepublication.py 1.27 => 1.27.10.1 ===
--- Zope3/src/zope/app/publication/zopepublication.py:1.27	Thu May  1 15:35:26 2003
+++ Zope3/src/zope/app/publication/zopepublication.py	Sun Jun 22 10:23:18 2003
@@ -26,7 +26,9 @@
 from zope.security.management import newSecurityManager
 from zope.security.checker import ProxyFactory
 
-from zope.proxy.introspection import removeAllProxies
+from zope.app.context import ContextWrapper
+
+from zope.proxy import removeAllProxies
 
 from zope.app.interfaces.services.service import IServiceManagerContainer
 
@@ -42,7 +44,7 @@
 
 from zope.app.publication.publicationtraverse import PublicationTraverse
 
-from zope.proxy.context import ContextWrapper
+from zope.app.context import ContextWrapper
 
 # XXX Should this be imported here?
 from transaction import get_transaction
@@ -73,7 +75,7 @@
             if p is None:
                 raise Unauthorized # If there's no default principal
 
-        request.user = ContextWrapper(p, prin_reg)
+        request.setUser(ContextWrapper(p, prin_reg))
         newSecurityManager(request.user)
         get_transaction().begin()
 
@@ -107,7 +109,7 @@
                 # nothing to do here
                 return
 
-        request.user = ContextWrapper(principal, auth_service)
+        request.setUser(ContextWrapper(principal, auth_service))
         newSecurityManager(request.user)
 
 
@@ -151,7 +153,7 @@
         if app is None:
             raise SystemError, "Zope Application Not Found"
 
-        return ProxyFactory(app)
+        return ProxyFactory(ContextWrapper(app, None))
 
     def callObject(self, request, ob):
         return mapply(ob, request.getPositionalArguments(), request)