Skip to content

Commit

Permalink
Merge pull request ABI-Software#18 from hsorby/debug
Browse files Browse the repository at this point in the history
Remove debug statements.
  • Loading branch information
nickerso authored Jul 7, 2020
2 parents fbda77f + 7ee5fb1 commit 286bd84
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,22 +248,17 @@ def get_owner_email(owner_id):
def thumbnail_by_image_id(image_id, recursive_call=False):
bl = Biolucida()

print('=====================')
print('thumbnail:', image_id)
with biolucida_lock:
print(bl.token())
if not bl.token():
authenticate_biolucida()

url = Config.BIOLUCIDA_ENDPOINT + "/thumbnail/{0}".format(image_id)
headers = {
'token': bl.token(),
}
print(url)
print(headers)

response = requests.request("GET", url, headers=headers)
encoded_content = base64.b64encode(response.content)
print(encoded_content)
# Response from this endpoint is binary on success so the easiest thing to do is
# check for an error response in encoded form.
if encoded_content == b'eyJzdGF0dXMiOiJBZG1pbiB1c2VyIGF1dGhlbnRpY2F0aW9uIHJlcXVpcmVkIHRvIHZpZXcvZWRpdCB1c2VyIGluZm8uIFlvdSBtYXkgbmVlZCB0byBsb2cgb3V0IGFuZCBsb2cgYmFjayBpbiB0byByZXZlcmlmeSB5b3VyIGNyZWRlbnRpYWxzLiJ9'\
Expand Down Expand Up @@ -295,8 +290,6 @@ def authenticate_biolucida():
]
headers = {}

print('about to post to:', url)
print(payload)
response = requests.request("POST", url, headers=headers, data=payload, files=files)
if response.status_code == requests.codes.ok:
content = response.json()
Expand Down

0 comments on commit 286bd84

Please sign in to comment.