[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher - BaseRequest.py:1.1.2.17

Andreas Jung andreas@digicool.com
Thu, 10 Jan 2002 14:06:37 -0500


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

Modified Files:
      Tag: Zope-3x-branch
	BaseRequest.py 
Log Message:
moved implementation of IViewRequest to BaseRequest while keeping a default
viewtype in HTTPRequest


=== Zope3/lib/python/Zope/Publisher/BaseRequest.py 1.1.2.16 => 1.1.2.17 ===
 from cgi import escape
 from types import StringType
-
+from Zope.ComponentArchitecture.IViewService import IViewRequest
 
 def pc_quote(s):
     """
@@ -38,6 +38,9 @@
     collection of variable to value mappings.
     """
 
+    __implements__ = IViewRequest
+    # XXX: maybe more to implement :-)
+
     body_instream = None  # The body input stream
     common = {}           # Data common to all requests
     args = ()             # Positional arguments
@@ -294,4 +297,36 @@
         Holds a reference to an object to delay its destruction until mine
         """
         self._held = self._held + (object,)
+
+
+    # Implementation methods for interface
+    # Zope.ComponentArchitecture.IViewService.IViewRequest
+
+    # Base classes might provide different attributes for this
+
+    _viewskin = ''
+    _viewtype = None
+    
+    def getViewSkin(self):
+        '''See interface IViewRequest'''
+
+        return self._viewskin
+
+
+    def setViewSkin(self, skin):
+        ''' add the view skin '''
+ 
+        self._viewskin = skin
+
+
+    def getViewType(self):
+        '''See interface IViewRequest'''
+
+        return self._viewtype
+
+
+    def setViewType(self, viewtype):
+        ''' set the view type '''
+
+        self._viewtype = viewtype