Commit 4bb07174 authored by Tres Seaver's avatar Tres Seaver

- Whitespace normalization.

parent 91b5cb3f
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
############################################################################## ##############################################################################
'''CGI Response Output formatter '''CGI Response Output formatter
$Id: BaseResponse.py,v 1.13 2002/06/22 14:02:41 tseaver Exp $''' $Id: BaseResponse.py,v 1.14 2002/06/22 14:04:56 tseaver Exp $'''
__version__='$Revision: 1.13 $'[11:-2] __version__ = '$Revision: 1.14 $'[11:-2]
import types, sys import types, sys
from types import StringType, InstanceType from types import StringType, InstanceType
...@@ -24,12 +24,12 @@ class BaseResponse: ...@@ -24,12 +24,12 @@ class BaseResponse:
What should be here? What should be here?
""" """
debug_mode=None debug_mode = None
_auth=None _auth = None
_error_format='text/plain' _error_format = 'text/plain'
# Allow (reluctantly) access to unprotected attributes # Allow (reluctantly) access to unprotected attributes
__allow_access_to_unprotected_subobjects__=1 __allow_access_to_unprotected_subobjects__ = 1
def __init__(self, stdout, stderr, def __init__(self, stdout, stderr,
body='', headers=None, status=None, cookies=None): body='', headers=None, status=None, cookies=None):
...@@ -37,20 +37,20 @@ class BaseResponse: ...@@ -37,20 +37,20 @@ class BaseResponse:
self.stderr = stderr self.stderr = stderr
self.body = body self.body = body
if headers is None: if headers is None:
headers={} headers = {}
self.headers = headers self.headers = headers
self.status = status self.status = status
if cookies is None: if cookies is None:
cookies={} cookies = {}
self.cookies = cookies self.cookies = cookies
def setStatus(self, status, reason=None): def setStatus(self, status, reason=None):
self.status = status self.status = status
def setHeader(self, name, value): def setHeader(self, name, value):
self.headers[name]=value self.headers[name] = value
__setitem__=setHeader __setitem__ = setHeader
def outputBody(self): def outputBody(self):
"""Output the response body""" """Output the response body"""
...@@ -78,8 +78,8 @@ class BaseResponse: ...@@ -78,8 +78,8 @@ class BaseResponse:
else: else:
cookie = cookies[name] = {} cookie = cookies[name] = {}
for k, v in kw.items(): for k, v in kw.items():
cookie[k]=v cookie[k] = v
cookie['value']=value cookie['value'] = value
def appendBody(self, body): def appendBody(self, body):
self.setBody(self.getBody() + body) self.setBody(self.getBody() + body)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment