Skip to content

Commit

Permalink
Set python-twitter timeout to 30 seconds
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Easterbrook <jim@jim-easterbrook.me.uk>
  • Loading branch information
jim-easterbrook committed Oct 9, 2015
1 parent 69f70e7 commit b44bfff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/pywws/ToTwitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
class TweepyHandler(object):
def __init__(self, key, secret, latitude, longitude):
self.logger = logging.getLogger('pywws.ToTwitter')
self.logger.info('Using tweepy library')
auth = tweepy.OAuthHandler(pct.consumer_key, pct.consumer_secret)
auth.set_access_token(key, secret)
self.api = tweepy.API(auth)
Expand All @@ -86,10 +87,13 @@ def post(self, status, media):

class PythonTwitterHandler(object):
def __init__(self, key, secret, latitude, longitude):
self.logger = logging.getLogger('pywws.ToTwitter')
self.logger.info('Using python-twitter library')
self.api = twitter.Api(
consumer_key=pct.consumer_key,
consumer_secret=pct.consumer_secret,
access_token_key=key, access_token_secret=secret)
access_token_key=key, access_token_secret=secret,
timeout=30)
if latitude is not None and longitude is not None:
self.kwargs = {'latitude' : latitude, 'longitude' : longitude,
'display_coordinates' : True}
Expand Down
6 changes: 3 additions & 3 deletions src/pywws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '15.09.0.dev1312'
_release = '1312'
_commit = '3ece3b7'
__version__ = '15.09.0.dev1313'
_release = '1313'
_commit = '69f70e7'

0 comments on commit b44bfff

Please sign in to comment.