Skip to content

Commit

Permalink
Remove API.api_root and API.upload_root
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Feb 3, 2021
1 parent c543427 commit e757919
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
5 changes: 2 additions & 3 deletions docs/api.rst
Expand Up @@ -12,8 +12,8 @@ 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], \
[retry_count=0], [retry_delay=0], [retry_errors=None], \
[timeout=60], [parser=ModelParser], \
[wait_on_rate_limit=False], [proxy=None])

This class provides a wrapper for the API as provided by Twitter.
Expand All @@ -22,7 +22,6 @@ This page contains some basic documentation for the Tweepy module.
:param auth_handler: authentication handler to be used
:param host: general API host
:param cache: cache backend to use
:param api_root: general API path root
:param retry_count: default number of retries to attempt when error occurs
:param retry_delay: number of seconds to wait between retries
:param retry_errors: which HTTP status codes to retry
Expand Down
9 changes: 2 additions & 7 deletions tweepy/api.py
Expand Up @@ -17,9 +17,8 @@ class API:

def __init__(self, auth_handler=None,
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, proxy=''):
cache=None, retry_count=0, retry_delay=0, retry_errors=None,
timeout=60, parser=None, wait_on_rate_limit=False, proxy=''):
"""
API instance constructor
Expand All @@ -29,8 +28,6 @@ def __init__(self, auth_handler=None,
:param upload_host: url of the upload server,
default: 'upload.twitter.com'
:param cache: Cache to query if a GET method is used, default: None
:param api_root: suffix of the api version, default: '/1.1'
:param upload_root: suffix of the upload version, default: '/1.1'
:param retry_count: number of allowed retries, default: 0
:param retry_delay: delay in second between retries, default: 0
:param retry_errors: default: None
Expand All @@ -47,8 +44,6 @@ def __init__(self, auth_handler=None,
self.auth = auth_handler
self.host = host
self.upload_host = upload_host
self.api_root = api_root
self.upload_root = upload_root
self.cache = cache
self.retry_count = retry_count
self.retry_delay = retry_delay
Expand Down
3 changes: 1 addition & 2 deletions tweepy/binder.py
Expand Up @@ -27,11 +27,10 @@ def bind_api(api, method, endpoint, *args, allowed_param=[], params=None,
api.cached_result = False

# Build the request URL
path = f'/1.1/{endpoint}.json'
if upload_api:
path = f'{api.upload_root}/{endpoint}.json'
url = 'https://' + api.upload_host + path
else:
path = f'{api.api_root}/{endpoint}.json'
url = 'https://' + api.host + path

if params is None:
Expand Down

0 comments on commit e757919

Please sign in to comment.