An authorisation bugfix

This commit is contained in:
Manuel Cortez 2015-03-01 20:41:02 -06:00
parent 0b12924874
commit 0ba120c3dd
3 changed files with 6 additions and 3 deletions

View File

@ -412,7 +412,7 @@ class baseBufferController(bufferController):
self.buffer.list.remove_item(index) self.buffer.list.remove_item(index)
# if index > 0: # if index > 0:
except TwythonError: except TwythonError:
sound.player.play("error.ogg") self.session.sound.play("error.ogg")
class eventsBufferController(bufferController): class eventsBufferController(bufferController):
def __init__(self, parent, name, session, account, *args, **kwargs): def __init__(self, parent, name, session, account, *args, **kwargs):

View File

@ -170,7 +170,10 @@ class Session(object):
finished = True finished = True
except TwythonError as e: except TwythonError as e:
output.speak(e.message) output.speak(e.message)
if report_failure and hasattr(e, 'message'): if e.error_code != 403 and e.error_code != 404:
tries = tries+1
time.sleep(5)
elif report_failure and hasattr(e, 'message'):
output.speak(_("%s failed. Reason: %s") % (action, e.message)) output.speak(_("%s failed. Reason: %s") % (action, e.message))
finished = True finished = True
except: except:

View File

@ -14,7 +14,7 @@ class twitter(object):
def authorise(self, settings): def authorise(self, settings):
httpd = BaseHTTPServer.HTTPServer(('127.0.0.1', 8080), authorisationHandler.handler) httpd = BaseHTTPServer.HTTPServer(('127.0.0.1', 8080), authorisationHandler.handler)
twitter = Twython(keyring.get("app_key"), keyring.get("app_secret"), auth_endpoint='authorize') twitter = Twython(keyring.get("api_key"), keyring.get("api_secret"), auth_endpoint='authorize')
auth = twitter.get_authentication_tokens("http://127.0.0.1:8080") auth = twitter.get_authentication_tokens("http://127.0.0.1:8080")
webbrowser.open_new_tab(auth['auth_url']) webbrowser.open_new_tab(auth['auth_url'])
# global logged, verifier # global logged, verifier