Fix (hack at) pycrest to fix caching issue when getting another character.
This commit is contained in:
@@ -147,22 +147,22 @@ class CrestCharacterInfo(wx.Dialog):
|
|||||||
|
|
||||||
mainSizer = wx.BoxSizer( wx.VERTICAL )
|
mainSizer = wx.BoxSizer( wx.VERTICAL )
|
||||||
|
|
||||||
self.headingText = wx.StaticText(self, wx.ID_ANY, "Currently logged in", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE )
|
self.characterText = wx.StaticText(self, wx.ID_ANY, self.char.name, wx.DefaultPosition, wx.DefaultSize)
|
||||||
self.headingText.Wrap( -1 )
|
|
||||||
self.headingText.SetFont( wx.Font( 12, 74, 90, 92, False) )
|
|
||||||
mainSizer.Add( self.headingText, 0, wx.EXPAND|wx.ALL, 5 )
|
|
||||||
|
|
||||||
self.pic = wx.StaticBitmap(self, -1, wx.EmptyBitmap(128, 128))
|
|
||||||
mainSizer.Add(self.pic, 0, wx.EXPAND, 5 )
|
|
||||||
|
|
||||||
self.characterText = wx.StaticText(self, wx.ID_ANY, self.char.name, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE )
|
|
||||||
self.characterText.Wrap( -1 )
|
self.characterText.Wrap( -1 )
|
||||||
self.characterText.SetFont( wx.Font( 11, 74, 90, 92, False) )
|
self.characterText.SetFont( wx.Font( 11, 74, 90, 92, False) )
|
||||||
mainSizer.Add( self.characterText, 0, wx.EXPAND|wx.ALL, 5 )
|
mainSizer.Add( self.characterText, 0, wx.ALIGN_CENTRE | wx.ALL, 5 )
|
||||||
|
|
||||||
self.coutdownText = wx.StaticText( self, wx.ID_ANY, "", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE)
|
self.pic = wx.StaticBitmap(self, -1, wx.EmptyBitmap(128, 128))
|
||||||
|
mainSizer.Add(self.pic, 0, wx.EXPAND|wx.ALIGN_CENTER, 5 )
|
||||||
|
|
||||||
|
self.coutdownText = wx.StaticText( self, wx.ID_ANY, "", wx.DefaultPosition, wx.DefaultSize)
|
||||||
self.coutdownText.Wrap( -1 )
|
self.coutdownText.Wrap( -1 )
|
||||||
mainSizer.Add( self.coutdownText, 0, wx.EXPAND, 5 )
|
mainSizer.Add( self.coutdownText, 0, wx.ALIGN_CENTER, 5 )
|
||||||
|
|
||||||
|
self.logoutBtn = wx.Button( self, wx.ID_ANY, u"Logout", wx.DefaultPosition, wx.DefaultSize, 5 )
|
||||||
|
mainSizer.Add( self.logoutBtn, 0, wx.ALIGN_CENTER|wx.ALL, 5 )
|
||||||
|
|
||||||
|
self.logoutBtn.Bind(wx.EVT_BUTTON, self.logout)
|
||||||
|
|
||||||
self.SetSizer( mainSizer )
|
self.SetSizer( mainSizer )
|
||||||
self.Centre( wx.BOTH )
|
self.Centre( wx.BOTH )
|
||||||
@@ -179,6 +179,10 @@ class CrestCharacterInfo(wx.Dialog):
|
|||||||
self.bitmapSet = True
|
self.bitmapSet = True
|
||||||
self.coutdownText.SetLabel(time.strftime("%H:%M:%S", t))
|
self.coutdownText.SetLabel(time.strftime("%H:%M:%S", t))
|
||||||
|
|
||||||
|
def logout(self, event):
|
||||||
|
sCrest = service.Crest.getInstance()
|
||||||
|
sCrest.logout()
|
||||||
|
self.Close()
|
||||||
|
|
||||||
class FittingsTreeView(wx.Panel):
|
class FittingsTreeView(wx.Panel):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
|
|||||||
@@ -258,9 +258,10 @@ class AuthedConnection(EVE):
|
|||||||
return self._data
|
return self._data
|
||||||
|
|
||||||
def whoami(self):
|
def whoami(self):
|
||||||
if 'whoami' not in self._cache:
|
#if 'whoami' not in self._cache:
|
||||||
self._cache['whoami'] = self.get("%s/verify" % self._oauth_endpoint)
|
# print "Setting this whoami cache"
|
||||||
return self._cache['whoami']
|
# self._cache['whoami'] = self.get("%s/verify" % self._oauth_endpoint)
|
||||||
|
return self.get("%s/verify" % self._oauth_endpoint)
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
res = self._authorize(params={"grant_type": "refresh_token", "refresh_token": self.refresh_token})
|
res = self._authorize(params={"grant_type": "refresh_token", "refresh_token": self.refresh_token})
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ class Crest():
|
|||||||
char = CrestUser(info['CharacterName'], info['CharacterID'], connection.refresh_token)
|
char = CrestUser(info['CharacterName'], info['CharacterID'], connection.refresh_token)
|
||||||
eos.db.save(char)
|
eos.db.save(char)
|
||||||
|
|
||||||
|
def logout(self):
|
||||||
|
self.implicitCharacter = None
|
||||||
|
|
||||||
def startServer(self):
|
def startServer(self):
|
||||||
thread.start_new_thread(self.httpd.serve, ())
|
thread.start_new_thread(self.httpd.serve, ())
|
||||||
self.state = str(uuid.uuid4())
|
self.state = str(uuid.uuid4())
|
||||||
|
|||||||
Reference in New Issue
Block a user