From: Harmon Date: Sun, 11 Apr 2021 18:35:47 +0000 (-0500) Subject: Update and improve documentation for API.simple_upload X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a90a66aa5016615171ba3c84c864496f1ed182f7;p=tweepy.git Update and improve documentation for API.simple_upload Automatically use docstring for documentation Improve documentation order --- diff --git a/docs/api.rst b/docs/api.rst index 2423e17..1b6c090 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -215,6 +215,8 @@ Upload media .. automethod:: API.media_upload +.. automethod:: API.simple_upload + Account Methods --------------- @@ -432,20 +434,6 @@ Utility methods Media methods ------------- -.. method:: API.simple_upload(filename, [file], [media_category], \ - [additional_owners]) - - Use this endpoint to upload media to Twitter. - This does not use the chunked upload endpoints. - - :param filename: |filename| - :param file: |file| - :param media_category: |media_category| - :param additional_owners: |additional_owners| - - :rtype: :class:`Media` object - - .. method:: API.chunked_upload(filename, [file], [file_type], \ [wait_for_async_finalize], [media_category], \ [additional_owners]) diff --git a/tweepy/api.py b/tweepy/api.py index 252e1fb..3289827 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -2393,7 +2393,19 @@ class API: @payload('media') def simple_upload(self, filename, *, file=None, media_category=None, additional_owners=None, **kwargs): - """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload + """simple_upload(filename, *, file, media_category, additional_owners) + + Use this endpoint to upload media to Twitter. This does not use the + chunked upload endpoints. + + :param filename: |filename| + :param file: |file| + :param media_category: |media_category| + :param additional_owners: |additional_owners| + + :rtype: :class:`Media` object + + :reference: https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-upload """ if file is not None: files = {'media': (filename, file)}