aboutsummaryrefslogtreecommitdiffstats
path: root/netlib/http/response.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-06-01 11:12:10 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-06-01 11:12:10 +1200
commit44fdcb4b8291a5be6738f32d6fde307af3f2034e (patch)
tree64a4a2cfa6295d0a367d5484a0d86bc5e22ab779 /netlib/http/response.py
parentbe644453649f0b0cf84822ad9de566b7dc744873 (diff)
downloadmitmproxy-44fdcb4b8291a5be6738f32d6fde307af3f2034e.tar.gz
mitmproxy-44fdcb4b8291a5be6738f32d6fde307af3f2034e.tar.bz2
mitmproxy-44fdcb4b8291a5be6738f32d6fde307af3f2034e.zip
Reorganise netlib imports according to Google Style Guide
Diffstat (limited to 'netlib/http/response.py')
-rw-r--r--netlib/http/response.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/netlib/http/response.py b/netlib/http/response.py
index 858b3aea..44b58be6 100644
--- a/netlib/http/response.py
+++ b/netlib/http/response.py
@@ -3,18 +3,18 @@ from __future__ import absolute_import, print_function, division
from email.utils import parsedate_tz, formatdate, mktime_tz
import time
-from . import cookies
-from .headers import Headers
-from .message import Message, _native, _always_bytes, MessageData
-from ..multidict import MultiDictView
-from .. import human
+from netlib.http import cookies
+from netlib.http import headers as nheaders
+from netlib.http import message
+from netlib import multidict
+from netlib import human
-class ResponseData(MessageData):
+class ResponseData(message.MessageData):
def __init__(self, http_version, status_code, reason=None, headers=(), content=None,
timestamp_start=None, timestamp_end=None):
- if not isinstance(headers, Headers):
- headers = Headers(headers)
+ if not isinstance(headers, nheaders.Headers):
+ headers = nheaders.Headers(headers)
self.http_version = http_version
self.status_code = status_code
@@ -25,7 +25,7 @@ class ResponseData(MessageData):
self.timestamp_end = timestamp_end
-class Response(Message):
+class Response(message.Message):
"""
An HTTP response.
"""
@@ -63,17 +63,17 @@ class Response(Message):
HTTP Reason Phrase, e.g. "Not Found".
This is always :py:obj:`None` for HTTP2 requests, because HTTP2 responses do not contain a reason phrase.
"""
- return _native(self.data.reason)
+ return message._native(self.data.reason)
@reason.setter
def reason(self, reason):
- self.data.reason = _always_bytes(reason)
+ self.data.reason = message._always_bytes(reason)
@property
def cookies(self):
- # type: () -> MultiDictView
+ # type: () -> multidict.MultiDictView
"""
- The response cookies. A possibly empty :py:class:`MultiDictView`, where the keys are
+ The response cookies. A possibly empty :py:class:`multidict.MultiDictView`, where the keys are
cookie name strings, and values are (value, attr) tuples. Value is a string, and attr is
an ODictCaseless containing cookie attributes. Within attrs, unary attributes (e.g. HTTPOnly)
are indicated by a Null value.
@@ -81,7 +81,7 @@ class Response(Message):
Caveats:
Updating the attr
"""
- return MultiDictView(
+ return multidict.MultiDictView(
self._get_cookies,
self._set_cookies
)