From 0ba120c3ddfca0b6f7b23fdca4d401402bad6b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Sun, 1 Mar 2015 20:41:02 -0600 Subject: [PATCH] An authorisation bugfix --- src/controller/buffersController.py | 2 +- src/sessionmanager/session.py | 5 ++++- src/twitter/twitter.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/controller/buffersController.py b/src/controller/buffersController.py index 844c7519..7032652c 100644 --- a/src/controller/buffersController.py +++ b/src/controller/buffersController.py @@ -412,7 +412,7 @@ class baseBufferController(bufferController): self.buffer.list.remove_item(index) # if index > 0: except TwythonError: - sound.player.play("error.ogg") + self.session.sound.play("error.ogg") class eventsBufferController(bufferController): def __init__(self, parent, name, session, account, *args, **kwargs): diff --git a/src/sessionmanager/session.py b/src/sessionmanager/session.py index 64823f6c..06eea94e 100644 --- a/src/sessionmanager/session.py +++ b/src/sessionmanager/session.py @@ -170,7 +170,10 @@ class Session(object): finished = True except TwythonError as e: 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)) finished = True except: diff --git a/src/twitter/twitter.py b/src/twitter/twitter.py index cc45c6d9..82e6bb1b 100644 --- a/src/twitter/twitter.py +++ b/src/twitter/twitter.py @@ -14,7 +14,7 @@ class twitter(object): def authorise(self, settings): 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") webbrowser.open_new_tab(auth['auth_url']) # global logged, verifier