(self, callingWindow, fullContext, mainItem, i)
| 29 | return _t("Split {} Stack").format(itmContext) |
| 30 | |
| 31 | def activate(self, callingWindow, fullContext, mainItem, i): |
| 32 | with DroneStackSplit(self.mainFrame, mainItem.amount) as dlg: |
| 33 | |
| 34 | if dlg.ShowModal() == wx.ID_OK: |
| 35 | |
| 36 | if dlg.input.GetLineText(0).strip() == '': |
| 37 | return |
| 38 | |
| 39 | fitID = self.mainFrame.getActiveFit() |
| 40 | fit = Fit.getInstance().getFit(fitID) |
| 41 | cleanInput = re.sub(r'[^0-9.]', '', dlg.input.GetLineText(0).strip()) |
| 42 | |
| 43 | if mainItem in fit.drones: |
| 44 | position = fit.drones.index(mainItem) |
| 45 | self.mainFrame.command.Submit(cmd.GuiSplitLocalDroneStackCommand( |
| 46 | fitID=fitID, position=position, amount=int(cleanInput))) |
| 47 | |
| 48 | |
| 49 | DroneSplitStack.register() |
nothing calls this directly
no test coverage detected