Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit ca04c73

Browse files
committed
Clean up excessively long lines
1 parent ea56e36 commit ca04c73

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

hyper/common/connection.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,14 @@ def __init__(self,
5858

5959
self._host = host
6060
self._port = port
61-
self._h1_kwargs = {'secure': secure, 'ssl_context': ssl_context, 'proxy_host': proxy_host, 'proxy_port': proxy_port }
61+
self._h1_kwargs = {
62+
'secure': secure, 'ssl_context': ssl_context,
63+
'proxy_host': proxy_host, 'proxy_port': proxy_port
64+
}
6265
self._h2_kwargs = {
6366
'window_manager': window_manager, 'enable_push': enable_push,
64-
'secure': secure, 'ssl_context': ssl_context, 'proxy_host': proxy_host, 'proxy_port': proxy_port
67+
'secure': secure, 'ssl_context': ssl_context,
68+
'proxy_host': proxy_host, 'proxy_port': proxy_port
6569
}
6670

6771
# Add any unexpected kwargs to both dictionaries.

hyper/http11/connection.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ class HTTP11Connection(object):
4747
port 443.
4848
:param ssl_context: (optional) A class with custom certificate settings.
4949
If not provided then hyper's default ``SSLContext`` is used instead.
50-
:param proxy_host: (optional) The proxy to connect to. This can be an IP address
51-
or a host name and may include a port.
50+
:param proxy_host: (optional) The proxy to connect to. This can be an IP
51+
address or a host name and may include a port.
5252
:param proxy_port: (optional) The proxy port to connect to. If not provided
53-
and one also isn't provided in the ``proxy`` parameter, defaults to 8080.
53+
and one also isn't provided in the ``proxy`` parameter,
54+
defaults to 8080.
5455
"""
5556
def __init__(self, host, port=None, secure=None, ssl_context=None,
5657
proxy_host=None, proxy_port=None, **kwargs):
@@ -203,7 +204,8 @@ def get_response(self):
203204
self._sock.advance_buffer(response.consumed)
204205

205206
if (response.status == 101 and
206-
b'upgrade' in headers['connection'] and H2C_PROTOCOL.encode('utf-8') in headers['upgrade']):
207+
b'upgrade' in headers['connection'] and
208+
H2C_PROTOCOL.encode('utf-8') in headers['upgrade']):
207209
raise HTTPUpgrade(H2C_PROTOCOL, self._sock)
208210

209211
return HTTP11Response(

test/server.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,16 @@ def get_connection(self):
117117
if not self.proxy:
118118
return HTTP20Connection(self.host, self.port, self.secure)
119119
else:
120-
return HTTP20Connection('http2bin.org', secure=self.secure, proxy_host=self.host, proxy_port=self.port)
120+
return HTTP20Connection('http2bin.org', secure=self.secure,
121+
proxy_host=self.host,
122+
proxy_port=self.port)
121123
else:
122124
if not self.proxy:
123125
return HTTP11Connection(self.host, self.port, self.secure)
124126
else:
125-
return HTTP11Connection('httpbin.org', secure=self.secure, proxy_host=self.host, proxy_port=self.port)
127+
return HTTP11Connection('httpbin.org', secure=self.secure,
128+
proxy_host=self.host,
129+
proxy_port=self.port)
126130

127131

128132
def get_encoder(self):

test/test_hyper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def test_connections_accept_proxy_hosts_and_ports(self):
5656
assert c.proxy_port == 8443
5757

5858
def test_connections_can_parse_proxy_hosts_and_ports(self):
59-
c = HTTP20Connection('www.google.com', proxy_host='localhost', proxy_port=8443)
59+
c = HTTP20Connection('www.google.com',
60+
proxy_host='localhost',
61+
proxy_port=8443)
6062
assert c.host == 'www.google.com'
6163
assert c.proxy_host == 'localhost'
6264
assert c.proxy_port == 8443

0 commit comments

Comments
 (0)