From ffb8a1f7416ac27407babfee2f20299586406861 Mon Sep 17 00:00:00 2001 From: Harmon Date: Tue, 6 Apr 2021 18:40:43 -0500 Subject: [PATCH] Update and improve documentation for API.get_status Automatically use docstring for documentation --- docs/api.rst | 20 ++------------------ tweepy/api.py | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 216d93b..64d9da0 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -43,28 +43,12 @@ Post, retrieve, and engage with Tweets .. automethod:: API.retweets_of_me +.. automethod:: API.get_status + Status methods -------------- -.. method:: API.get_status(id, [trim_user], [include_my_retweet], \ - [include_entities], [include_ext_alt_text], \ - [include_card_uri]) - - Returns a single status specified by the ID parameter. - - :param id: |sid| - :param trim_user: |trim_user| - :param include_my_retweet: A boolean indicating if any Tweets returned that - have been retweeted by the authenticating user should include an - additional current_user_retweet node, containing the ID of the source - status for the retweet. - :param include_entities: |include_entities| - :param include_ext_alt_text: |include_ext_alt_text| - :param include_card_uri: |include_card_uri| - :rtype: :class:`Status` object - - .. method:: API.update_status(status, [in_reply_to_status_id], \ [auto_populate_reply_metadata], \ [exclude_reply_user_ids], [attachment_url], \ diff --git a/tweepy/api.py b/tweepy/api.py index 2a25475..24e9978 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -540,7 +540,24 @@ class API: @payload('status') def get_status(self, id, **kwargs): - """ :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-show-id + """get_status(id, *, trim_user, include_my_retweet, include_entities, \ + include_ext_alt_text, include_card_uri) + + Returns a single status specified by the ID parameter. + + :param id: |sid| + :param trim_user: |trim_user| + :param include_my_retweet: A boolean indicating if any Tweets returned + that have been retweeted by the authenticating user should include + an additional current_user_retweet node, containing the ID of the + source status for the retweet. + :param include_entities: |include_entities| + :param include_ext_alt_text: |include_ext_alt_text| + :param include_card_uri: |include_card_uri| + + :rtype: :class:`Status` object + + :reference: https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-show-id """ return self.request( 'GET', 'statuses/show', endpoint_parameters=( -- 2.25.1