From 9e75283030549b4ca0b6ddd0102ceae67e88e282 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sun, 11 Apr 2021 13:47:17 -0500 Subject: [PATCH] Update and improve documentation for API.chunked_upload_init Automatically use docstring for documentation Improve documentation order --- docs/api.rst | 18 ++---------------- tweepy/api.py | 14 +++++++++++++- 2 files changed, 15 insertions(+), 17 deletions(-) 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'} -- 2.25.1