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

Method Do

gui/fitCommands/gui/localModule/remove.py:22–43  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

20 self.savedRemovedDummies = None
21
22 def Do(self):
23 sMkt = Market.getInstance()
24 sFit = Fit.getInstance()
25 fit = sFit.getFit(self.fitID)
26 self.savedTypeIDs = {m.itemID for m in fit.modules if not m.isEmpty}
27 cmd = CalcRemoveLocalModulesCommand(fitID=self.fitID, positions=self.positions)
28 success = self.internalHistory.submit(cmd)
29 for container in (cmd.savedSubInfos, cmd.savedModInfos):
30 for position in sorted(container, reverse=True):
31 modInfo = container[position]
32 sMkt.storeRecentlyUsed(modInfo.itemID)
33 if cmd.needsGuiRecalc:
34 eos.db.flush()
35 sFit.recalc(self.fitID)
36 self.savedRemovedDummies = sFit.fill(self.fitID)
37 eos.db.commit()
38 wx.PostEvent(
39 gui.mainFrame.MainFrame.getInstance(),
40 GE.FitChanged(fitIDs=(self.fitID,), action='moddel', typeID=self.savedTypeIDs)
41 if success and self.savedTypeIDs else
42 GE.FitChanged(fitIDs=(self.fitID,)))
43 return success
44
45 def Undo(self):
46 sFit = Fit.getInstance()

Callers

nothing calls this directly

Calls 8

getFitMethod · 0.80
submitMethod · 0.80
storeRecentlyUsedMethod · 0.80
flushMethod · 0.80
recalcMethod · 0.80
getInstanceMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected