From: Harmon Date: Tue, 2 Feb 2021 22:12:05 +0000 (-0600) Subject: Remove API.wait_on_rate_limit_notify X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f3257389ed566029e7eec0598597afeef6900d35;p=tweepy.git Remove API.wait_on_rate_limit_notify --- diff --git a/docs/api.rst b/docs/api.rst index 3517090..95ea04e 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -14,8 +14,7 @@ This page contains some basic documentation for the Tweepy module. .. class:: API([auth_handler=None], [host='api.twitter.com'], [cache=None], \ [api_root='/1'], , [retry_count=0], [retry_delay=0], \ [retry_errors=None], [timeout=60], [parser=ModelParser], \ - [compression=False], [wait_on_rate_limit=False], \ - [wait_on_rate_limit_notify=False], [proxy=None]) + [compression=False], [wait_on_rate_limit=False], [proxy=None]) This class provides a wrapper for the API as provided by Twitter. The functions provided in this class are listed below. @@ -33,9 +32,6 @@ This page contains some basic documentation for the Tweepy module. :param compression: Whether or not to use GZIP compression for requests :param wait_on_rate_limit: Whether or not to automatically wait for rate limits to replenish - :param wait_on_rate_limit_notify: Whether or not to print a notification - when Tweepy is waiting for rate limits to - replenish :param proxy: The full url to an HTTPS proxy to use for connecting to Twitter. diff --git a/tweepy/api.py b/tweepy/api.py index bf3beab..c2fb43a 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -19,8 +19,7 @@ class API: host='api.twitter.com', upload_host='upload.twitter.com', cache=None, api_root='/1.1', upload_root='/1.1', retry_count=0, retry_delay=0, retry_errors=None, timeout=60, - parser=None, wait_on_rate_limit=False, - wait_on_rate_limit_notify=False, proxy=''): + parser=None, wait_on_rate_limit=False, proxy=''): """ API instance constructor @@ -41,8 +40,6 @@ class API: default: None :param wait_on_rate_limit: If the api wait when it hits the rate limit, default: False - :param wait_on_rate_limit_notify: If the api print a notification when - the rate limit is hit, default: False :param proxy: Url to use as proxy during the HTTP request, default: '' :raise TypeError: If the given parser is not a ModelParser instance. @@ -58,7 +55,6 @@ class API: self.retry_errors = retry_errors self.timeout = timeout self.wait_on_rate_limit = wait_on_rate_limit - self.wait_on_rate_limit_notify = wait_on_rate_limit_notify self.parser = parser or ModelParser() self.proxy = {} if proxy: diff --git a/tweepy/binder.py b/tweepy/binder.py index e57c4d5..8fe97f3 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -91,8 +91,7 @@ def execute(api, method, path, *args, allowed_param=[], params=None, # Handle running out of API calls sleep_time = reset_time - int(time.time()) if sleep_time > 0: - if api.wait_on_rate_limit_notify: - log.warning(f"Rate limit reached. Sleeping for: {sleep_time}") + log.warning(f"Rate limit reached. Sleeping for: {sleep_time}") time.sleep(sleep_time + 1) # Sleep for extra sec # Apply authentication