[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - ZopePublication.py:1.14

Jim Fulton jim@zope.com
Thu, 19 Dec 2002 14:43:44 -0500


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

Modified Files:
	ZopePublication.py 
Log Message:
  revision 1.13.4.1
  date: 2002/12/19 17:25:16;  author: jim;  state: Exp;  lines: +16 -7
  Got rid of RequestContainer decoy.

  Added mix-in class to aid debugging to allow setting a breakpoint at
  the call to an applicatiuon object.


=== Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py 1.13 => 1.14 ===
--- Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py:1.13	Fri Dec  6 08:12:09 2002
+++ Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py	Thu Dec 19 14:43:43 2002
@@ -46,13 +46,6 @@
 # XXX Should this be imported here?
 from Transaction import get_transaction
 
-class RequestContainer:
-    # TODO: add security assertion declaring access to REQUEST
-
-    def __init__(self, request):
-        self.REQUEST = request
-
-
 class Cleanup:
     def __init__(self, f):
         self.__del__ = f
@@ -243,3 +236,19 @@
     def _parameterSetskin(self, pname, pval, request):
         request.setViewSkin(pval)
         
+class DebugPublication(object):
+
+    class call_wrapper:
+
+        def __init__(self, ob):
+            self.__ob = ob
+
+        def __getattr__(self, name):
+            return getattr(self.__ob, name)
+
+        def __call__(self, *args, **kw):
+            self.__ob(*args, **kw)
+
+    def callObject(self, request, ob):
+        return mapply(self.call_wrapper(ob),
+                      request.getPositionalArguments(), request)