Skip to content

Commit

Permalink
fix: use .format instead of str()
Browse files Browse the repository at this point in the history
  • Loading branch information
s-pace committed May 16, 2019
1 parent bbead67 commit 11728aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion deployer/src/algolia_internal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def get_headers():
admin_api_key = environ.get('API_KEY_PROD').encode()
auth_token = b64encode(app_id + b":" + admin_api_key).decode().replace('=',
'').replace(

"\n", '')

return {
Expand Down
14 changes: 9 additions & 5 deletions deployer/src/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ def make_request(endpoint, type=None, data=None, username=None, password=None,
data=data)

if r.status_code // 100 != 2:
print("ISSUE for POST request : " + url + " with params: " + str(
data))
print(
'ISSUE for POST request : {} with params: {}'.format(url,
data))
print(r.text)
return r

Expand All @@ -88,8 +89,9 @@ def make_request(endpoint, type=None, data=None, username=None, password=None,
data=data)
print(r.status_code)
if r.status_code // 100 != 2:
print("ISSUE for PUT request : " + url + " with params: " + str(
data))
print(
'ISSUE for PUT request : {} with params: {}'.format(url,
data))
return r

if data != None:
Expand All @@ -101,7 +103,9 @@ def make_request(endpoint, type=None, data=None, username=None, password=None,
auth=(username, password))

if r.status_code // 100 != 2:
print("ISSUE for GET request : " + url + " with params:" + data)
print(
'ISSUE for GET request : {} with params: {}'.format(url,
data))

if json_request:
r.json()
Expand Down
2 changes: 1 addition & 1 deletion scraper/src/strategies/default_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _get_text_content_for_level(self, node, current_level, selectors):
if 'attributes' in selectors[current_level]:
attributes = {}
for attribute_name in list(selectors[current_level][
'attributes'].keys()):
'attributes'].keys()):
matching_nodes = node.xpath(
selectors[current_level]['attributes'][attribute_name][
'selector'])
Expand Down

0 comments on commit 11728aa

Please sign in to comment.