Move to a central login() method
This commit is contained in:
@@ -781,8 +781,7 @@ class APIView(wx.Panel):
|
||||
|
||||
def addCharacter(self, event):
|
||||
sEsi = Esi.getInstance()
|
||||
uri = sEsi.startServer()
|
||||
webbrowser.open(uri)
|
||||
sEsi.login()
|
||||
|
||||
def getActiveCharacter(self):
|
||||
selection = self.charChoice.GetCurrentSelection()
|
||||
|
||||
@@ -344,8 +344,7 @@ class SsoCharacterMgmt(wx.Dialog):
|
||||
@staticmethod
|
||||
def addChar(event):
|
||||
sEsi = Esi.getInstance()
|
||||
uri = sEsi.startServer()
|
||||
webbrowser.open(uri)
|
||||
sEsi.login()
|
||||
|
||||
def delChar(self, event):
|
||||
item = self.lcCharacters.GetFirstSelected()
|
||||
|
||||
@@ -5,5 +5,6 @@ FitChanged, FIT_CHANGED = wx.lib.newevent.NewEvent()
|
||||
CharListUpdated, CHAR_LIST_UPDATED = wx.lib.newevent.NewEvent()
|
||||
CharChanged, CHAR_CHANGED = wx.lib.newevent.NewEvent()
|
||||
|
||||
SsoLoggingIn, EVT_SSO_LOGGING_IN = wx.lib.newevent.NewEvent()
|
||||
SsoLogin, EVT_SSO_LOGIN = wx.lib.newevent.NewEvent()
|
||||
SsoLogout, EVT_SSO_LOGOUT = wx.lib.newevent.NewEvent()
|
||||
|
||||
@@ -9,6 +9,7 @@ import base64
|
||||
import json
|
||||
import os
|
||||
import config
|
||||
import webbrowser
|
||||
|
||||
import eos.db
|
||||
import datetime
|
||||
@@ -179,6 +180,12 @@ class Esi(object):
|
||||
if char.esi_client is not None:
|
||||
char.esi_client.security.update_token(tokenResponse)
|
||||
|
||||
def login(self):
|
||||
# Switch off how we do things here depending on the mode of authentication
|
||||
uri = self.startServer()
|
||||
webbrowser.open(uri)
|
||||
wx.PostEvent(self.mainFrame, GE.SsoLoggingIn())
|
||||
|
||||
def stopServer(self):
|
||||
pyfalog.debug("Stopping Server")
|
||||
self.httpd.stop()
|
||||
|
||||
Reference in New Issue
Block a user