Commit a6008ecb authored by Joshua Roesslein's avatar Joshua Roesslein
Browse files

Merge pull request #285.

- Fix code style issue.
parents 40842e88 24ea4229
......@@ -17,7 +17,7 @@ class API(object):
def __init__(self, auth_handler=None,
host='api.twitter.com', search_host='search.twitter.com',
cache=None, secure=True, api_root='/1.1', search_root='',
retry_count=0, retry_delay=0, retry_errors=None,
retry_count=0, retry_delay=0, retry_errors=None, timeout=60,
parser=None):
self.auth = auth_handler
self.host = host
......@@ -29,6 +29,7 @@ class API(object):
self.retry_count = retry_count
self.retry_delay = retry_delay
self.retry_errors = retry_errors
self.timeout = timeout
self.parser = parser or ModelParser()
""" statuses/home_timeline """
......
......@@ -128,11 +128,10 @@ def bind_api(**config):
retries_performed = 0
while retries_performed < self.retry_count + 1:
# Open connection
# FIXME: add timeout
if self.api.secure:
conn = httplib.HTTPSConnection(self.host)
conn = httplib.HTTPSConnection(self.host, timeout=self.api.timeout)
else:
conn = httplib.HTTPConnection(self.host)
conn = httplib.HTTPConnection(self.host, timeout=self.api.timeout)
# Apply authentication
if self.api.auth:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment