[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher/Browser - AttributePublisher.py:1.1.2.15 BrowserRequest.py:1.1.4.10 BrowserResponse.py:1.1.4.6

Shane Hathaway shane@cvs.zope.org
Fri, 12 Apr 2002 17:31:23 -0400


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

Modified Files:
      Tag: Zope-3x-branch
	AttributePublisher.py BrowserRequest.py BrowserResponse.py 
Log Message:
Merged Zope3-Server-Branch.


=== Zope3/lib/python/Zope/Publisher/Browser/AttributePublisher.py 1.1.2.14 => 1.1.2.15 ===
 # 
 ##############################################################################
+"""
+
+$Id$
+"""
 from IBrowserPublisher import IBrowserPublisher
 
 class AttributePublisher(object):


=== Zope3/lib/python/Zope/Publisher/Browser/BrowserRequest.py 1.1.4.9 => 1.1.4.10 ===
     
 
-    def __init__(self, body_instream, outstream, environ):
+    def __init__(self, body_instream, outstream, environ, response=None):
         self._form = {}
-        super(BrowserRequest, self).__init__(body_instream, outstream, environ)
+        super(BrowserRequest, self).__init__(
+            body_instream, outstream, environ, response)
 
 
     def _createResponse(self, outstream):


=== Zope3/lib/python/Zope/Publisher/Browser/BrowserResponse.py 1.1.4.5 => 1.1.4.6 ===
         
         Sets the return body equal to the (string) argument "body". Also
-        updates the "content-length" return header.
-
-        If the body is a 2-element tuple, then it will be treated
-        as (title,body)
-        
-        If is_error is true then the HTML will be formatted as a Zope error
-        message instead of a generic HTML page.
+        updates the "content-length" return header and sets the status to
+        200 if it has not already been set.
         """
         body = str(body)
 
@@ -65,6 +60,8 @@
         body = self.__insertBase(body)
         self._body = body
         self._updateContentLength()
+        if not self._status_set:
+            self.setStatus(200)
 
     def __isHTML(self, str):
         s = str.strip().lower()
@@ -85,7 +82,7 @@
     def __insertBase(self, body):
         # Only insert a base tag if content appears to be html.
         content_type = self.getHeader('content-type', '')
-        if content_type and content_type != 'text/html':
+        if content_type and not is_text_html(content_type):
             return body
 
         if getattr(self, '_base', ''):