[Zope3-checkins] CVS: Zope3/lib/python/Zope/ContextWrapper - SimpleMethodWrapper.py:1.11 __init__.py:1.6

Jim Fulton jim@zope.com
Thu, 5 Dec 2002 11:55:23 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/ContextWrapper
In directory cvs.zope.org:/tmp/cvs-serv28979

Modified Files:
	SimpleMethodWrapper.py __init__.py 
Log Message:
Added ContextSuper to call base methods that are context methods.


=== Zope3/lib/python/Zope/ContextWrapper/SimpleMethodWrapper.py 1.10 => 1.11 ===
--- Zope3/lib/python/Zope/ContextWrapper/SimpleMethodWrapper.py:1.10	Tue Dec  3 16:54:08 2002
+++ Zope3/lib/python/Zope/ContextWrapper/SimpleMethodWrapper.py	Thu Dec  5 11:55:23 2002
@@ -122,3 +122,14 @@
 wrapperTypes = (SimpleMethodWrapper, SimpleCallableMethodWrapper,
                 SimpleGetitemMethodWrapper,
                 SimpleCallableGetitemMethodWrapper)
+
+class ContextSuper:
+
+    def __init__(self, class_, inst):
+        self.__inst = inst
+        self.__class = class_
+
+    def __getattr__(self, name):
+        inst = self.__inst
+        return getattr(super(self.__class, getbaseobject(inst)), name
+                       ).__get__(inst)


=== Zope3/lib/python/Zope/ContextWrapper/__init__.py 1.5 => 1.6 ===
--- Zope3/lib/python/Zope/ContextWrapper/__init__.py:1.5	Tue Dec  3 16:54:09 2002
+++ Zope3/lib/python/Zope/ContextWrapper/__init__.py	Thu Dec  5 11:55:23 2002
@@ -27,4 +27,5 @@
 from SimpleMethodWrapper import ContextGetProperty, ContextSetProperty
 
 from SimpleMethodWrapper import wrapperTypes
+from SimpleMethodWrapper import ContextSuper