[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/HTTP - HTTPPublicationTraverse.py:1.1.4.3

Steve Alexander steve@cat-box.net
Wed, 17 Apr 2002 18:33:31 -0400


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

Modified Files:
      Tag: Zope-3x-branch
	HTTPPublicationTraverse.py 
Log Message:
Amended various modules to import Wrapper, getdict and getcontext from
Zope.ContextWrapper rather than Zope.ContextWrapper.wrapper

Added a SimpleMethodWrapper, which is a rather hacky python way of
rebinding methods so that the im_self gets wrapped.

Now, you'll get a SimpleMethodWrapper rather than a Wrapper when you
say from Zope.ContextWrapper import Wrapper

You say that a particular method should get its im_self rebound by
making it into a ContextMethod, in a similar way to making a staticmethod
or a classmethod.

See the testSimpleMethodWrapper.py module for an example.



=== Zope3/lib/python/Zope/App/ZopePublication/HTTP/HTTPPublicationTraverse.py 1.1.4.2 => 1.1.4.3 ===
 from Zope.Publisher.Exceptions import NotFound
 from types import StringTypes
-from Zope.ContextWrapper import wrapper
+from Zope.ContextWrapper import Wrapper
 
 class DuplicateNamespaces(Exception):
     """More than one namespave was specified in a request"""
@@ -105,7 +105,7 @@
 
 
     def _wrap(self, ob, parent, name, nm):
-        wrapped = wrapper.Wrapper(ob, parent, name=name)
+        wrapped = Wrapper(ob, parent, name=name)
         getSecurityManager().validate(nm, wrapped)
         return wrapped