get fit deletion working. Need to be aware that we are still using cached fit listing...
This commit is contained in:
@@ -474,7 +474,7 @@ def getSsoCharacters(clientHash, eager=None):
|
||||
return characters
|
||||
|
||||
|
||||
@cachedQuery(SsoCharacter, 1, "lookfor")
|
||||
@cachedQuery(SsoCharacter, 1, "lookfor", "clientHash")
|
||||
def getSsoCharacter(lookfor, clientHash, eager=None):
|
||||
filter = SsoCharacter.client == clientHash
|
||||
|
||||
|
||||
@@ -161,12 +161,12 @@ class CrestFittings(wx.Frame):
|
||||
data = json.loads(self.fitTree.fittingsTreeCtrl.GetItemData(selection))
|
||||
|
||||
dlg = wx.MessageDialog(self,
|
||||
"Do you really want to delete %s (%s) from EVE?" % (data['name'], data['ship']['name']),
|
||||
"Do you really want to delete %s (%s) from EVE?" % (data['name'], getItem(data['ship_type_id']).name),
|
||||
"Confirm Delete", wx.YES | wx.NO | wx.ICON_QUESTION)
|
||||
|
||||
if dlg.ShowModal() == wx.ID_YES:
|
||||
try:
|
||||
sCrest.delFitting(self.getActiveCharacter(), data['fittingID'])
|
||||
sCrest.delFitting(self.getActiveCharacter(), data['fitting_id'])
|
||||
except requests.exceptions.ConnectionError:
|
||||
msg = "Connection error, please check your internet connection"
|
||||
pyfalog.error(msg)
|
||||
@@ -389,8 +389,8 @@ class FittingsTreeView(wx.Panel):
|
||||
for fit in fits:
|
||||
ship = getItem(fit['ship_type_id'])
|
||||
if ship.name not in dict:
|
||||
dict[ship.name ] = []
|
||||
dict[ship.name ].append(fit)
|
||||
dict[ship.name] = []
|
||||
dict[ship.name].append(fit)
|
||||
|
||||
for name, fits in dict.items():
|
||||
shipID = tree.AppendItem(root, name)
|
||||
|
||||
@@ -60,6 +60,10 @@ class Crest(object):
|
||||
clientCallback = 'http://localhost:6461'
|
||||
clientTest = True
|
||||
|
||||
esiapp = None
|
||||
esi_v1 = None
|
||||
esi_v4 = None
|
||||
|
||||
_instance = None
|
||||
|
||||
@classmethod
|
||||
@@ -176,6 +180,7 @@ class Crest(object):
|
||||
|
||||
def getFittings(self, charID):
|
||||
char = self.getSsoCharacter(charID)
|
||||
print(repr(char))
|
||||
op = Crest.esi_v1.op['get_characters_character_id_fittings'](
|
||||
character_id=charID
|
||||
)
|
||||
@@ -190,7 +195,15 @@ class Crest(object):
|
||||
|
||||
def delFitting(self, charID, fittingID):
|
||||
char = self.getSsoCharacter(charID)
|
||||
return char.eve.delete('%scharacters/%d/fittings/%d/' % (char.eve._authed_endpoint, char.ID, fittingID))
|
||||
print(repr(char))
|
||||
op = Crest.esi_v1.op['delete_characters_character_id_fittings_fitting_id'](
|
||||
character_id=charID,
|
||||
fitting_id=fittingID
|
||||
)
|
||||
|
||||
resp = char.esi_client.request(op)
|
||||
return resp.data
|
||||
|
||||
|
||||
def logout(self):
|
||||
"""Logout of implicit character"""
|
||||
|
||||
Reference in New Issue
Block a user