def _openAfterImport(self, fits): if len(fits) > 0: if len(fits) == 1: fit = fits[0] wx.PostEvent(self, FitSelected(fitID=fit.ID)) wx.PostEvent(self.shipBrowser, Stage3Selected(shipID=fit.shipID, back=True)) else: wx.PostEvent(self.shipBrowser, ImportSelected(fits=fits, back=True))
def activate(self, fullContext, selection, i): fitID = self.mainFrame.getActiveFit() sFit = service.Fit.getInstance() stuff = sFit.getFit(fitID).ship groupID = stuff.item.group.ID self.mainFrame.notebookBrowsers.SetSelection(1) wx.PostEvent(self.mainFrame.shipBrowser,Stage3Selected(shipID=stuff.item.ID, back=groupID))
def _openAfterImport(self, fits): if len(fits) > 0: if len(fits) == 1: fit = fits[0] wx.PostEvent(self, FitSelected(fitID=fit.ID)) wx.PostEvent(self.shipBrowser, Stage3Selected(shipID=fit.shipID, back=True)) else: fits.sort(key=lambda _fit: (_fit.ship.item.name, _fit.name)) results = [] for fit in fits: results.append((fit.ID, fit.name, fit.modifiedCoalesce, fit.ship.item, fit.notes)) wx.PostEvent(self.shipBrowser, ImportSelected(fits=results, back=True))