diff options
author | bbangert <devnull@localhost> | 2006-10-17 21:49:50 +0000 |
---|---|---|
committer | bbangert <devnull@localhost> | 2006-10-17 21:49:50 +0000 |
commit | b8498ced24fd43118e2026dd63d6410d93c0fdae (patch) | |
tree | 06369085d95b20ce0e9d703b25ac97387be59c6d /paste/wsgiwrappers.py | |
parent | f7c6b226edbbe6f7bde870e2ee1d7c241484b450 (diff) | |
download | paste-b8498ced24fd43118e2026dd63d6410d93c0fdae.tar.gz |
Added dict access to WSGIResponse object, like the doc string indicates it had the whole time.
Diffstat (limited to 'paste/wsgiwrappers.py')
-rw-r--r-- | paste/wsgiwrappers.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/paste/wsgiwrappers.py b/paste/wsgiwrappers.py index 3c768fc..228c374 100644 --- a/paste/wsgiwrappers.py +++ b/paste/wsgiwrappers.py @@ -195,6 +195,18 @@ class WSGIResponse(object): return iter(lambda: self.content.read(), '') return self.get_content_as_string() + def __setitem__(self, header, value): + self.headers[header] = value + + def __delitem__(self, header): + try: + del self.headers[header] + except KeyError: + pass + + def __getitem__(self, header): + return self.headers[header] + def determine_encoding(self): """ Determine the encoding as specified by the Content-Type's charset |