Update and improve documentation for API.chunked_upload
authorHarmon <Harmon758@gmail.com>
Sun, 11 Apr 2021 18:39:48 +0000 (13:39 -0500)
committerHarmon <Harmon758@gmail.com>
Sun, 11 Apr 2021 18:39:48 +0000 (13:39 -0500)
Automatically use docstring for documentation
Improve documentation order

docs/api.rst
tweepy/api.py

index 1b6c09093f0d6dbc2061e81eaf6b89be4ecbe821..69be3f7dd8823e897e5bc69766edebd337e35366 100644 (file)
@@ -217,6 +217,8 @@ Upload media
 
 .. automethod:: API.simple_upload
 
+.. automethod:: API.chunked_upload
+
 
 Account Methods
 ---------------
@@ -434,28 +436,6 @@ Utility methods
 Media methods
 -------------
 
-.. method:: API.chunked_upload(filename, [file], [file_type], \
-                               [wait_for_async_finalize], [media_category], \
-                               [additional_owners])
-
-   Use this to upload media to Twitter.
-   This uses the chunked upload endpoints and calls
-   :func:`API.chunked_upload_init`, :func:`API.chunked_upload_append`, and
-   :func:`API.chunked_upload_finalize`.
-   If ``wait_for_async_finalize`` is set, this calls
-   :func:`API.get_media_upload_status` as well.
-
-   :param filename: |filename|
-   :param file: |file|
-   :param file_type: The MIME type of the media being uploaded.
-   :param wait_for_async_finalize: Whether to wait for Twitter's API to finish
-                                   processing the media. Defaults to ``True``.
-   :param media_category: |media_category|
-   :param additional_owners: |additional_owners|
-
-   :rtype: :class:`Media` object
-
-
 .. method:: API.chunked_upload_init(total_bytes, media_type, \
                                     [media_category], [additional_owners])
 
index 3289827331ba0da37e82391c8c85e6f717b2d4f4..3f1f525c0253a0e6405d349c273e1d5e4c529dbe 100644 (file)
@@ -2426,7 +2426,27 @@ class API:
     def chunked_upload(self, filename, *, file=None, file_type=None,
                        wait_for_async_finalize=True, media_category=None,
                        additional_owners=None, **kwargs):
-        """ :reference https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/uploading-media/chunked-media-upload
+        """chunked_upload(filename, *, file, file_type, \
+                          wait_for_async_finalize, media_category, \
+                          additional_owners)
+
+        Use this to upload media to Twitter. This uses the chunked upload
+        endpoints and calls :func:`API.chunked_upload_init`,
+        :func:`API.chunked_upload_append`, and
+        :func:`API.chunked_upload_finalize`. If ``wait_for_async_finalize`` is
+        set, this calls :func:`API.get_media_upload_status` as well.
+
+        :param filename: |filename|
+        :param file: |file|
+        :param file_type: The MIME type of the media being uploaded.
+        :param wait_for_async_finalize: Whether to wait for Twitter's API to
+            finish processing the media. Defaults to ``True``.
+        :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/uploading-media/chunked-media-upload
         """
         fp = file or open(filename, 'rb')