(self, event)
| 150 | self.mainFrame._openAfterImport(fits) |
| 151 | |
| 152 | def deleteFitting(self, event): |
| 153 | self.statusbar.SetStatusText("") |
| 154 | sEsi = Esi.getInstance() |
| 155 | selection = self.fitView.fitSelection |
| 156 | if not selection: |
| 157 | return |
| 158 | data = json.loads(self.fitTree.fittingsTreeCtrl.GetItemData(selection)) |
| 159 | |
| 160 | with wx.MessageDialog( |
| 161 | self, _t("Do you really want to delete {} ({}) from EVE?").format(data['name'], getItem(data['ship_type_id']).name), |
| 162 | _t("Confirm Delete"), wx.YES | wx.NO | wx.ICON_QUESTION |
| 163 | ) as dlg: |
| 164 | if dlg.ShowModal() == wx.ID_YES: |
| 165 | activeChar = self.getActiveCharacter() |
| 166 | if activeChar is None: |
| 167 | return |
| 168 | try: |
| 169 | try: |
| 170 | sEsi.delFitting(activeChar, data['fitting_id']) |
| 171 | # repopulate the fitting list |
| 172 | self.fitTree.populateSkillTree(self.fittings) |
| 173 | self.fitView.update([]) |
| 174 | except APIException as ex: |
| 175 | pyfalog.error(ex) |
| 176 | self.statusbar.SetStatusText("Failed to delete fit: ESI error {} received - {}".format(ex.status_code, ex.response["error"])) |
| 177 | try: |
| 178 | ESIExceptionHandler(ex) |
| 179 | except: |
| 180 | # don't need to do anything - we should already have error code in the status |
| 181 | pass |
| 182 | except requests.exceptions.ConnectionError: |
| 183 | msg = _t("Connection error, please check your internet connection") |
| 184 | pyfalog.error(msg) |
| 185 | self.statusbar.SetStatusText(msg) |
| 186 | |
| 187 | def deleteAllFittings(self, event): |
| 188 | self.statusbar.SetStatusText("") |
nothing calls this directly
no test coverage detected