Error check for fetch skills added. Display a message in all cases

This commit is contained in:
HomeWorld
2010-12-04 21:04:27 +02:00
parent fe3b195946
commit c09cae2804

View File

@@ -149,6 +149,7 @@ class CharacterEditor(wx.Frame):
self.aview.btnFetchCharList.Show()
self.aview.btnFetchSkills.Hide()
self.aview.charList.Hide()
self.aview.stStatus.SetLabel("")
self.aview.Layout()
def unrestrict(self):
@@ -160,6 +161,7 @@ class CharacterEditor(wx.Frame):
self.aview.btnFetchCharList.Show()
self.aview.btnFetchSkills.Hide()
self.aview.charList.Hide()
self.aview.stStatus.SetLabel("")
self.aview.Layout()
def charChanged(self, event):
@@ -608,5 +610,9 @@ class APIView (wx.Panel):
item = self.charList.GetNextItem(-1, wx.LIST_NEXT_ALL, wx.LIST_STATE_SELECTED)
charName = self.charList.GetItemText(item)
if charName:
cChar = service.Character.getInstance()
cChar.apiFetch(self.Parent.Parent.getActiveCharacter(), charName)
try:
cChar = service.Character.getInstance()
cChar.apiFetch(self.Parent.Parent.getActiveCharacter(), charName)
self.stStatus.SetLabel("Successfully fetched %s\'s skills from EVE API." % charName)
except:
self.stStatus.SetLabel("Unable to retrieve %s\'s skills!" % charName)