From: Harmon Date: Sun, 11 Apr 2021 18:47:17 +0000 (-0500) Subject: Update and improve documentation for API.chunked_upload_init X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9e75283030549b4ca0b6ddd0102ceae67e88e282;p=tweepy.git Update and improve documentation for API.chunked_upload_init Automatically use docstring for documentation Improve documentation order --- diff --git a/docs/api.rst b/docs/api.rst index f1d79e2..d096222 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -223,6 +223,8 @@ Upload media .. automethod:: API.chunked_upload_finalize +.. automethod:: API.chunked_upload_init + Account Methods --------------- @@ -437,22 +439,6 @@ Utility methods when they are loaded, but no more than once a day. -Media methods -------------- - -.. method:: API.chunked_upload_init(total_bytes, media_type, \ - [media_category], [additional_owners]) - - Use this endpoint to initiate a chunked file upload session. - - :param total_bytes: The size of the media being uploaded in bytes. - :param media_type: The MIME type of the media being uploaded. - :param media_category: |media_category| - :param additional_owners: |additional_owners| - - :rtype: :class:`Media` object - - :mod:`tweepy.error` --- Exceptions ================================== diff --git a/tweepy/api.py b/tweepy/api.py index 44b7f15..c334874 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -2543,7 +2543,19 @@ class API: def chunked_upload_init(self, total_bytes, media_type, *, 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-init + """chunked_upload_init(total_bytes, media_type, *, media_category, \ + additional_owners) + + Use this endpoint to initiate a chunked file upload session. + + :param total_bytes: The size of the media being uploaded in bytes. + :param media_type: The MIME type of the media being uploaded. + :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-init """ headers = {'Content-Type': 'application/x-www-form-urlencoded'}