Skip to content

Commit

Permalink
In Python 3.7 the async keyword cannot be used to add param async=1 t…
Browse files Browse the repository at this point in the history
…o flickr API
  • Loading branch information
codavs65r committed Dec 21, 2018
1 parent a4a9670 commit 5470e6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flickrapi/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ def do_upload(self, filename, url, params=None, fileobj=None, timeout=None):
if 'title' not in params:
params['title'] = os.path.basename(filename).encode('utf8')

if 'asynchronous' in params:
if int(params['asynchronous']) == 1:
params['async'] = '1'
params.pop('asynchronous')

# work-around for Flickr expecting 'photo' to be excluded
# from the oauth signature:
# 1. create a dummy request without 'photo'
Expand Down
4 changes: 4 additions & 0 deletions flickrapi/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ def upload(self, filename, fileobj=None, timeout=None, **kwargs):
hidden
Set to "1" to keep the photo in global search results, "2"
to hide from public searches.
asynchronous
Set to "1" to do async upload
format
The response format. You can only choose between the
parsed responses or 'rest' for plain REST.
Expand Down Expand Up @@ -504,6 +506,8 @@ def replace(self, filename, photo_id, fileobj=None, timeout=None, **kwargs):
an optional file-like object from which the data can be read
photo_id
the ID of the photo to replace
asynchronous
Set to "1" to do async upload
format
The response format. You can only choose between the
parsed responses or 'rest' for plain REST. Defaults to the
Expand Down

0 comments on commit 5470e6f

Please sign in to comment.