Stop IOLoop when callback page reached with GUI browser
This commit is contained in:
@@ -28,6 +28,9 @@ class HomeHandler(web.RequestHandler):
|
||||
|
||||
class AuthHandler(web.RequestHandler):
|
||||
|
||||
def initialize(self):
|
||||
self.compact = os.environ.get('BROWSER') in ['w3m', 'links', 'elinks', 'lynx']
|
||||
|
||||
def get(self):
|
||||
global oauth_state
|
||||
global oauth_code
|
||||
@@ -39,6 +42,10 @@ class AuthHandler(web.RequestHandler):
|
||||
|
||||
self.render('auth.html', state=oauth_state, code=oauth_code, error=oauth_error)
|
||||
|
||||
# Stop IOLoop if using BackgroundBrowser (or GUI browser)
|
||||
if not self.compact:
|
||||
ioloop.IOLoop.current().stop()
|
||||
|
||||
class OAuthTool(object):
|
||||
|
||||
def __init__(self, reddit, stdscr=None, loader=None,
|
||||
|
||||
Reference in New Issue
Block a user