From: Harmon Date: Tue, 25 Oct 2022 23:26:51 +0000 (-0500) Subject: Change API method docstrings to raw strings X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fb851a0192cb97d321611eb33427b872ff5ccbb9;p=tweepy.git Change API method docstrings to raw strings Prevent DeprecationWarnings about invalid escape sequences --- diff --git a/tweepy/api.py b/tweepy/api.py index 29c4976..50d241b 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -292,8 +292,8 @@ class API: @pagination(mode='next') @payload('status', list=True) def search_30_day(self, label, query, **kwargs): - """search_30_day(label, query, *, tag, fromDate, toDate, maxResults, \ - next) + r"""search_30_day(label, query, *, tag, fromDate, toDate, maxResults, \ + next) Premium search that provides Tweets posted within the last 30 days. @@ -375,8 +375,8 @@ class API: @pagination(mode='next') @payload('status', list=True) def search_full_archive(self, label, query, **kwargs): - """search_full_archive(label, query, *, tag, fromDate, toDate, \ - maxResults, next) + r"""search_full_archive(label, query, *, tag, fromDate, toDate, \ + maxResults, next) Premium search that provides Tweets from as early as 2006, starting with the first Tweet posted in March 2006. @@ -461,8 +461,8 @@ class API: @pagination(mode='id') @payload('status', list=True) def home_timeline(self, **kwargs): - """home_timeline(*, count, since_id, max_id, trim_user, \ - exclude_replies, include_entities) + r"""home_timeline(*, count, since_id, max_id, trim_user, \ + exclude_replies, include_entities) Returns the 20 most recent statuses, including retweets, posted by the authenticating user and that user's friends. This is the equivalent @@ -501,8 +501,8 @@ class API: @pagination(mode='id') @payload('status', list=True) def mentions_timeline(self, **kwargs): - """mentions_timeline(*, count, since_id, max_id, trim_user, \ - include_entities) + r"""mentions_timeline(*, count, since_id, max_id, trim_user, \ + include_entities) Returns the 20 most recent mentions, including retweets. @@ -536,8 +536,8 @@ class API: @pagination(mode='id') @payload('status', list=True) def user_timeline(self, **kwargs): - """user_timeline(*, user_id, screen_name, since_id, count, max_id, \ - trim_user, exclude_replies, include_rts) + r"""user_timeline(*, user_id, screen_name, since_id, count, max_id, \ + trim_user, exclude_replies, include_rts) Returns the 20 most recent statuses posted from the authenticating user or the user specified. It's also possible to request another user's @@ -586,8 +586,8 @@ class API: @pagination(mode='id') @payload('status', list=True) def get_favorites(self, **kwargs): - """get_favorites(*, user_id, screen_name, count, since_id, max_id, \ - include_entities) + r"""get_favorites(*, user_id, screen_name, count, since_id, max_id, \ + include_entities) Returns the favorite statuses for the authenticating user or user specified by the ID parameter. @@ -627,8 +627,8 @@ class API: @payload('status', list=True) def lookup_statuses(self, id, **kwargs): - """lookup_statuses(id, *, include_entities, trim_user, map, \ - include_ext_alt_text, include_card_uri) + r"""lookup_statuses(id, *, include_entities, trim_user, map, \ + include_ext_alt_text, include_card_uri) Returns full Tweet objects for up to 100 Tweets per request, specified by the ``id`` parameter. @@ -759,7 +759,7 @@ class API: @pagination(mode='cursor') @payload('ids') def get_retweeter_ids(self, id, **kwargs): - """get_retweeter_ids(id, *, count, cursor, stringify_ids) + r"""get_retweeter_ids(id, *, count, cursor, stringify_ids) Returns up to 100 user IDs belonging to users who have retweeted the Tweet specified by the ``id`` parameter. @@ -794,7 +794,7 @@ class API: @payload('status', list=True) def get_retweets(self, id, **kwargs): - """get_retweets(id, *, count, trim_user) + r"""get_retweets(id, *, count, trim_user) Returns up to 100 of the first Retweets of the given Tweet. @@ -827,8 +827,8 @@ class API: @pagination(mode='id') @payload('status', list=True) def get_retweets_of_me(self, **kwargs): - """get_retweets_of_me(*, count, since_id, max_id, trim_user, \ - include_entities, include_user_entities) + r"""get_retweets_of_me(*, count, since_id, max_id, trim_user, \ + include_entities, include_user_entities) Returns the 20 most recent Tweets of the authenticated user that have been retweeted by others. @@ -1215,8 +1215,8 @@ class API: @pagination(mode='id') @payload('search_results') def search_tweets(self, q, **kwargs): - """search_tweets(q, *, geocode, lang, locale, result_type, count, \ - until, since_id, max_id, include_entities) + r"""search_tweets(q, *, geocode, lang, locale, result_type, count, \ + until, since_id, max_id, include_entities) Returns a collection of relevant Tweets matching a specified query. @@ -1317,7 +1317,7 @@ class API: @payload('list', list=True) def get_lists(self, **kwargs): - """get_lists(*, user_id, screen_name, reverse) + r"""get_lists(*, user_id, screen_name, reverse) Returns all lists the authenticating or specified user subscribes to, including their own. The user is specified using the ``user_id`` or @@ -1362,8 +1362,8 @@ class API: @pagination(mode='cursor') @payload('user', list=True) def get_list_members(self, **kwargs): - """get_list_members(*, list_id, slug, owner_screen_name, owner_id, \ - count, cursor, include_entities, skip_status) + r"""get_list_members(*, list_id, slug, owner_screen_name, owner_id, \ + count, cursor, include_entities, skip_status) Returns the members of the specified list. @@ -1459,8 +1459,8 @@ class API: @pagination(mode='cursor') @payload('list', list=True) def get_list_memberships(self, **kwargs): - """get_list_memberships(*, user_id, screen_name, count, cursor, \ - filter_to_owned_lists) + r"""get_list_memberships(*, user_id, screen_name, count, cursor, \ + filter_to_owned_lists) Returns the lists the specified user has been added to. If ``user_id`` or ``screen_name`` are not provided, the memberships for the @@ -1502,7 +1502,7 @@ class API: @pagination(mode='cursor') @payload('list', list=True) def get_list_ownerships(self, **kwargs): - """get_list_ownerships(*, user_id, screen_name, count, cursor) + r"""get_list_ownerships(*, user_id, screen_name, count, cursor) Returns the lists owned by the specified user. Private lists will only be shown if the authenticated user is also the owner of the lists. If @@ -1569,7 +1569,7 @@ class API: @pagination(mode='id') @payload('status', list=True) def list_timeline(self, **kwargs): - """list_timeline( \ + r"""list_timeline( \ *, list_id, slug, owner_screen_name, owner_id, since_id, max_id, \ count, include_entities, include_rts \ ) @@ -1620,7 +1620,7 @@ class API: @pagination(mode='cursor') @payload('user', list=True) def get_list_subscribers(self, **kwargs): - """get_list_subscribers( \ + r"""get_list_subscribers( \ *, list_id, slug, owner_screen_name, owner_id, count, cursor, \ include_entities, skip_status \ ) @@ -1719,7 +1719,7 @@ class API: @pagination(mode='cursor') @payload('list', list=True) def get_list_subscriptions(self, **kwargs): - """get_list_subscriptions(*, user_id, screen_name, count, cursor) + r"""get_list_subscriptions(*, user_id, screen_name, count, cursor) Obtain a collection of the lists the specified user is subscribed to, 20 lists per page by default. Does not include the user's own lists. @@ -2087,8 +2087,8 @@ class API: @pagination(mode='cursor') @payload('ids') def get_follower_ids(self, **kwargs): - """get_follower_ids(*, user_id, screen_name, cursor, stringify_ids, \ - count) + r"""get_follower_ids(*, user_id, screen_name, cursor, stringify_ids, \ + count) Returns an array containing the IDs of users following the specified user. @@ -2126,8 +2126,8 @@ class API: @pagination(mode='cursor') @payload('user', list=True) def get_followers(self, **kwargs): - """get_followers(*, user_id, screen_name, cursor, count, skip_status, \ - include_user_entities) + r"""get_followers(*, user_id, screen_name, cursor, count, skip_status, \ + include_user_entities) Returns a user's followers ordered in which they were added. If no user is specified by id/screen name, it defaults to the authenticated user. @@ -2168,8 +2168,8 @@ class API: @pagination(mode='cursor') @payload('ids') def get_friend_ids(self, **kwargs): - """get_friend_ids(*, user_id, screen_name, cursor, stringify_ids, \ - count) + r"""get_friend_ids(*, user_id, screen_name, cursor, stringify_ids, \ + count) Returns an array containing the IDs of users being followed by the specified user. @@ -2207,8 +2207,8 @@ class API: @pagination(mode='cursor') @payload('user', list=True) def get_friends(self, **kwargs): - """get_friends(*, user_id, screen_name, cursor, count, skip_status, \ - include_user_entities) + r"""get_friends(*, user_id, screen_name, cursor, count, skip_status, \ + include_user_entities) Returns a user's friends ordered in which they were added 100 at a time. If no user is specified it defaults to the authenticated user. @@ -2249,7 +2249,7 @@ class API: @pagination(mode='cursor') @payload('ids') def incoming_friendships(self, **kwargs): - """incoming_friendships(*, cursor, stringify_ids) + r"""incoming_friendships(*, cursor, stringify_ids) Returns a collection of numeric IDs for every user who has a pending request to follow the authenticating user. @@ -2280,7 +2280,7 @@ class API: @payload('relationship', list=True) def lookup_friendships(self, *, screen_name=None, user_id=None, **kwargs): - """lookup_friendships(*, screen_name, user_id) + r"""lookup_friendships(*, screen_name, user_id) Returns the relationships of the authenticated user to the list of up to 100 screen_name or user_id provided. @@ -2309,7 +2309,7 @@ class API: @payload('ids') def no_retweets_friendships(self, **kwargs): - """no_retweets_friendships(*, stringify_ids) + r"""no_retweets_friendships(*, stringify_ids) Returns a collection of user_ids that the currently authenticated user does not want to receive retweets from. @@ -2336,7 +2336,7 @@ class API: @pagination(mode='cursor') @payload('ids') def outgoing_friendships(self, **kwargs): - """outgoing_friendships(*, cursor, stringify_ids) + r"""outgoing_friendships(*, cursor, stringify_ids) Returns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request. @@ -2403,7 +2403,7 @@ class API: @payload('user', list=True) def lookup_users(self, *, screen_name=None, user_id=None, **kwargs): - """lookup_users(*, screen_name, user_id, include_entities, tweet_mode) + r"""lookup_users(*, screen_name, user_id, include_entities, tweet_mode) Returns fully-hydrated user objects for up to 100 users per request. @@ -2450,7 +2450,7 @@ class API: @pagination(mode='page') @payload('user', list=True) def search_users(self, q, **kwargs): - """search_users(q, *, page, count, include_entities) + r"""search_users(q, *, page, count, include_entities) Run a search for users similar to Find People button on Twitter.com; the same results returned by people search on Twitter.com will be @@ -2660,7 +2660,7 @@ class API: @payload('saved_search', list=True) def get_saved_searches(self, **kwargs): - """get_saved_searches() + r"""get_saved_searches() Returns the authenticated user's saved search queries. @@ -2974,7 +2974,7 @@ class API: @pagination(mode='cursor') @payload('ids') def get_blocked_ids(self, **kwargs): - """get_blocked_ids(*, stringify_ids, cursor) + r"""get_blocked_ids(*, stringify_ids, cursor) Returns an array of numeric user IDs the authenticating user is blocking. @@ -3006,7 +3006,7 @@ class API: @pagination(mode='cursor') @payload('user', list=True) def get_blocks(self, **kwargs): - """get_blocks(*, include_entities, skip_status, cursor) + r"""get_blocks(*, include_entities, skip_status, cursor) Returns an array of user objects that the authenticating user is blocking. @@ -3040,7 +3040,7 @@ class API: @pagination(mode='cursor') @payload('ids') def get_muted_ids(self, **kwargs): - """get_muted_ids(*, stringify_ids, cursor) + r"""get_muted_ids(*, stringify_ids, cursor) Returns an array of numeric user IDs the authenticating user has muted. @@ -3071,7 +3071,7 @@ class API: @pagination(mode='cursor') @payload('user', list=True) def get_mutes(self, **kwargs): - """get_mutes(*, cursor, include_entities, skip_status) + r"""get_mutes(*, cursor, include_entities, skip_status) Returns an array of user objects the authenticating user has muted. @@ -3286,7 +3286,7 @@ class API: @pagination(mode='dm_cursor') @payload('direct_message', list=True) def get_direct_messages(self, **kwargs): - """get_direct_messages(*, count, cursor) + r"""get_direct_messages(*, count, cursor) Returns all Direct Message events (both sent and received) within the last 30 days. Sorted in reverse-chronological order. @@ -3944,7 +3944,7 @@ class API: @payload('place', list=True) def reverse_geocode(self, lat, long, **kwargs): - """reverse_geocode(lat, long, *, accuracy, granularity, max_results) + r"""reverse_geocode(lat, long, *, accuracy, granularity, max_results) Given a latitude and a longitude, searches for up to 20 places that can be used as a ``place_id`` when updating a status. @@ -3985,7 +3985,7 @@ class API: @payload('place', list=True) def search_geo(self, **kwargs): - """search_geo(*, lat, long, query, ip, granularity, max_results) + r"""search_geo(*, lat, long, query, ip, granularity, max_results) Search for places that can be attached to a Tweet via :func:`API.update_status`. Given a latitude and a longitude pair, an IP