MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / Do

Method Do

gui/fitCommands/gui/projectedRemove.py:42–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

40 self.pFitIDs.append(item.ID)
41
42 def Do(self):
43 results = []
44 needRecalc = True
45 for pModPosition in sorted(self.pModPositions, reverse=True):
46 cmd = CalcRemoveProjectedModuleCommand(fitID=self.fitID, position=pModPosition)
47 results.append(self.internalHistory.submit(cmd))
48 needRecalc = cmd.needsGuiRecalc
49 for pDroneItemID in self.pDroneItemIDs:
50 cmd = CalcRemoveProjectedDroneCommand(fitID=self.fitID, itemID=pDroneItemID, amount=self.amount)
51 results.append(self.internalHistory.submit(cmd))
52 needRecalc = True
53 for pFighterPosition in sorted(self.pFighterPositions, reverse=True):
54 cmd = CalcRemoveProjectedFighterCommand(fitID=self.fitID, position=pFighterPosition)
55 results.append(self.internalHistory.submit(cmd))
56 needRecalc = True
57 for pFitID in self.pFitIDs:
58 cmd = CalcRemoveProjectedFitCommand(fitID=self.fitID, projectedFitID=pFitID, amount=self.amount)
59 results.append(self.internalHistory.submit(cmd))
60 needRecalc = cmd.needsGuiRecalc
61 success = any(results)
62 sFit = Fit.getInstance()
63 if needRecalc:
64 eos.db.flush()
65 sFit.recalc(self.fitID)
66 sFit.fill(self.fitID)
67 eos.db.commit()
68 wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitIDs=(self.fitID,)))
69 return success
70
71 def Undo(self):
72 success = self.internalHistory.undoAll()

Callers

nothing calls this directly

Calls 10

submitMethod · 0.80
flushMethod · 0.80
recalcMethod · 0.80
appendMethod · 0.45
getInstanceMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected