Skip to content

Commit f7d52f8

Browse files
committed
Made python-http-client to autopep8
1 parent 9d94522 commit f7d52f8

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

python_http_client/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@
1313
ServiceUnavailableError,
1414
GatewayTimeoutError
1515
)
16-

python_http_client/client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
class Response(object):
1818
"""Holds the response from an API call."""
19+
1920
def __init__(self, response):
2021
"""
2122
:param response: The return value from a open call
@@ -57,6 +58,7 @@ def to_dict(self):
5758

5859
class Client(object):
5960
"""Quickly and easily access any REST or REST-like API."""
61+
6062
def __init__(self,
6163
host,
6264
request_headers=None,
@@ -117,7 +119,8 @@ def _build_url(self, query_params):
117119
if query_params:
118120
url_values = urlencode(sorted(query_params.items()), True)
119121
url = '{0}?{1}'.format(url, url_values)
120-
url = self._build_versioned_url(url) if self._version else self.host + url
122+
url = self._build_versioned_url(
123+
url) if self._version else self.host + url
121124
return url
122125

123126
def _update_headers(self, request_headers):
@@ -212,9 +215,11 @@ def http_request(*_, **kwargs):
212215
if self.request_headers['Content-Type'] != 'application/json':
213216
data = kwargs['request_body'].encode('utf-8')
214217
else:
215-
data = json.dumps(kwargs['request_body']).encode('utf-8')
218+
data = json.dumps(
219+
kwargs['request_body']).encode('utf-8')
216220
else:
217-
data = json.dumps(kwargs['request_body']).encode('utf-8')
221+
data = json.dumps(
222+
kwargs['request_body']).encode('utf-8')
218223
params = kwargs['query_params'] if 'query_params' in kwargs else None
219224
opener = urllib.build_opener()
220225
request = urllib.Request(self._build_url(params), data=data)

python_http_client/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
class HTTPError(Exception):
55
''' Base of all other errors'''
6+
67
def __init__(self, error):
78
self.status_code = error.code
89
self.reason = error.reason

0 commit comments

Comments
 (0)