summaryrefslogtreecommitdiff
path: root/paste/wsgiwrappers.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-10-20 22:08:05 +0000
committerianb <devnull@localhost>2006-10-20 22:08:05 +0000
commit44fa5352360b78696c3d81cafa8e24eaa4f6c3ed (patch)
treeccde2c446f352cb5344f3c9a40090f12290bf9a7 /paste/wsgiwrappers.py
parent9eadab4b64440958f99a2fa1798227bb4a53193c (diff)
downloadpaste-44fa5352360b78696c3d81cafa8e24eaa4f6c3ed.tar.gz
A big commit, primarily aesthetic/whitespace in nature. This is the result of running pylint over the codebase. Some minor/hard-to-reach typos were also picked up.
Diffstat (limited to 'paste/wsgiwrappers.py')
-rw-r--r--paste/wsgiwrappers.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/paste/wsgiwrappers.py b/paste/wsgiwrappers.py
index c67431a..de5bf1d 100644
--- a/paste/wsgiwrappers.py
+++ b/paste/wsgiwrappers.py
@@ -54,7 +54,7 @@ class WSGIRequest(object):
You are free to subclass this object.
"""
- def __init__(self, environ, urlvars={}):
+ def __init__(self, environ):
self.environ = environ
# This isn't "state" really, since the object is derivative:
self.headers = EnvironHeaders(environ)
@@ -140,8 +140,8 @@ class WSGIResponse(object):
self.cookies = SimpleCookie()
self.status_code = code
if not mimetype:
- mimetype = "%s; charset=%s" % (settings['content_type'],
- settings['charset'])
+ mimetype = "%s; charset=%s" % (settings['content_type'],
+ settings['charset'])
self.headers['Content-Type'] = mimetype
if 'encoding_errors' in settings:
@@ -218,10 +218,11 @@ class WSGIResponse(object):
Define a cookie to be sent via the outgoing HTTP headers
"""
self.cookies[key] = value
- for var in ('max_age', 'path', 'domain', 'secure', 'expires'):
- val = locals()[var]
- if val is not None:
- self.cookies[key][var.replace('_', '-')] = val
+ for var_name, var_value in [
+ ('max_age', max_age), ('path', path), ('domain', domain),
+ ('secure', secure), ('expires', expires)]:
+ if var_value is not None:
+ self.cookies[key][var_name.replace('_', '-')] = var_value
def delete_cookie(self, key, path='/', domain=None):
"""