[Zope-Checkins] CVS: Zope/lib/python/ZPublisher - BaseResponse.py:1.13
Tres Seaver
tseaver@zope.com
Sat, 22 Jun 2002 10:02:41 -0400
Update of /cvs-repository/Zope/lib/python/ZPublisher
In directory cvs.zope.org:/tmp/cvs-serv19536
Modified Files:
BaseResponse.py
Log Message:
- Whitespace normalization.
=== Zope/lib/python/ZPublisher/BaseResponse.py 1.12 => 1.13 ===
def __init__(self, stdout, stderr,
body='', headers=None, status=None, cookies=None):
- self.stdout=stdout
- self.stderr=stderr
- self.body=body
- if headers is None: headers={}
- self.headers=headers
- self.status=status
- if cookies is None: cookies={}
- self.cookies=cookies
+ self.stdout = stdout
+ self.stderr = stderr
+ self.body = body
+ if headers is None:
+ headers={}
+ self.headers = headers
+ self.status = status
+ if cookies is None:
+ cookies={}
+ self.cookies = cookies
def setStatus(self, status, reason=None):
- self.status=status
+ self.status = status
def setHeader(self, name, value):
self.headers[name]=value
@@ -55,7 +57,7 @@
self.stdout.write(str(self))
def setBody(self, body):
- self.body=body
+ self.body = body
def getStatus(self):
'Returns the current HTTP status code as an integer. '
@@ -70,10 +72,11 @@
"value". This overwrites any previously set value for the
cookie in the Response object.
'''
- cookies=self.cookies
+ cookies = self.cookies
if cookies.has_key(name):
- cookie=cookies[name]
- else: cookie=cookies[name]={}
+ cookie = cookies[name]
+ else:
+ cookie = cookies[name] = {}
for k, v in kw.items():
cookie[k]=v
cookie['value']=value
@@ -104,7 +107,8 @@
def __repr__(self):
return '%s(%s)' % (self.__class__.__name__, `self.body`)
- def flush(self): pass
+ def flush(self):
+ pass
def write(self,data):
"""\
@@ -121,7 +125,7 @@
after beginning stream-oriented output.
"""
- self.body=self.body+data
+ self.body = self.body+data
def exception(self, fatal=0, info=None):
"""Handle an exception.