[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - ZopePublication.py:1.1.2.16

Fred Drake Jr fdrake@acm.org
Sat, 1 Dec 2001 15:40:05 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv4313

Modified Files:
      Tag: Zope-3x-branch
	ZopePublication.py 
Log Message:
Simplify the wrapper-creation code in BrowserPublication.  This should be
a little faster, and avoids creating temporaries that are not needed.


=== Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py 1.1.2.15 => 1.1.2.16 ===
                 raise NotFound(ob, name, request)
 
-        wrapped = wrapper.Wrapper(ob2, ob)
-        d = wrapper.getdictcreate(wrapped)
-        d['name'] = name
-        return wrapped
-            
-        raise NotFound(ob, name, request)
+        return wrapper.Wrapper(ob2, ob, name=name)
 
     def getDefaultTraversal(self, request, ob):
-        r = _marker = []
-
         if IBrowserPublisher.isImplementedBy(ob):
             r = ob.browser_default(request)
         else:
             adapter = getPresentation(ob, '_traverse', IBrowserPublisher, None)
             if adapter is not None:
                 r = adapter.browser_default(request)
-        if r is _marker:
-            return (ob, None)
-        else:
-            wrapped = wrapper.Wrapper(r[0], ob)
-            d = wrapper.getdictcreate(wrapped)
-            # the following may need to be fixed, as this component
-            # does assert a name, though we have no way of
-            # getting it here - chrism
-            d['name'] = ''
-            return (wrapped, r[1])
+            else:
+                return (ob, None)
 
+        # the following may need to be fixed, as this component
+        # does assert a name, though we have no way of
+        # getting it here - chrism
+        return (wrapper.Wrapper(r[0], ob, name=''), None)