Merge 7caa688146 into 0d00ae97fb
This commit is contained in:
commit
908f426d37
1 changed files with 4 additions and 2 deletions
|
|
@ -104,7 +104,7 @@ class TwythonRateLimitError(TwythonError):
|
||||||
|
|
||||||
class Twython(object):
|
class Twython(object):
|
||||||
def __init__(self, app_key=None, app_secret=None, oauth_token=None, oauth_token_secret=None, \
|
def __init__(self, app_key=None, app_secret=None, oauth_token=None, oauth_token_secret=None, \
|
||||||
headers=None, callback_url=None, twitter_token=None, twitter_secret=None):
|
headers=None, callback_url=None, twitter_token=None, twitter_secret=None, proxies=None):
|
||||||
"""Instantiates an instance of Twython. Takes optional parameters for authentication and such (see below).
|
"""Instantiates an instance of Twython. Takes optional parameters for authentication and such (see below).
|
||||||
|
|
||||||
:param app_key: (optional) Your applications key
|
:param app_key: (optional) Your applications key
|
||||||
|
|
@ -113,6 +113,7 @@ class Twython(object):
|
||||||
:param oauth_secret: (optional) Used with oauth_token to make authenticated calls
|
:param oauth_secret: (optional) Used with oauth_token to make authenticated calls
|
||||||
:param headers: (optional) Custom headers to send along with the request
|
:param headers: (optional) Custom headers to send along with the request
|
||||||
:param callback_url: (optional) If set, will overwrite the callback url set in your application
|
:param callback_url: (optional) If set, will overwrite the callback url set in your application
|
||||||
|
:param proxies: (optional) A dictionary of proxies, for example {"http":"proxy.example.org:8080", "https":"proxy.example.org:8081"}.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Needed for hitting that there API.
|
# Needed for hitting that there API.
|
||||||
|
|
@ -161,7 +162,8 @@ class Twython(object):
|
||||||
if self.client is None:
|
if self.client is None:
|
||||||
# If they don't do authentication, but still want to request
|
# If they don't do authentication, but still want to request
|
||||||
# unprotected resources, we need an opener.
|
# unprotected resources, we need an opener.
|
||||||
self.client = requests.session()
|
print proxies
|
||||||
|
self.client = requests.session(proxies=proxies)
|
||||||
|
|
||||||
# register available funcs to allow listing name when debugging.
|
# register available funcs to allow listing name when debugging.
|
||||||
def setFunc(key):
|
def setFunc(key):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue