Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

In Python 3.7 the async keyword cannot be used to add param async=1 t… #117

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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