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

Method Do

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

Source from the content-addressed store, hash-verified

20 self.savedRemovedDummies = None
21
22 def Do(self):
23 results = []
24 needRecalc = None
25 for position in self.positions:
26 cmd = CalcReplaceLocalModuleCommand(
27 fitID=self.fitID,
28 position=position,
29 newModInfo=ModuleInfo(itemID=self.itemID))
30 results.append(self.internalHistory.submit(cmd))
31 # Last command decides if we need it or not
32 needRecalc = cmd.needsGuiRecalc
33 success = any(results)
34 Market.getInstance().storeRecentlyUsed(self.itemID)
35 sFit = Fit.getInstance()
36 if needRecalc:
37 eos.db.flush()
38 sFit.recalc(self.fitID)
39 self.savedRemovedDummies = sFit.fill(self.fitID)
40 eos.db.commit()
41 wx.PostEvent(
42 gui.mainFrame.MainFrame.getInstance(),
43 GE.FitChanged(fitIDs=(self.fitID,), action='modadd', typeID=self.itemID)
44 if success else
45 GE.FitChanged(fitIDs=(self.fitID,)))
46 return success
47
48 def Undo(self):
49 sFit = Fit.getInstance()

Callers

nothing calls this directly

Calls 9

ModuleInfoClass · 0.90
submitMethod · 0.80
storeRecentlyUsedMethod · 0.80
flushMethod · 0.80
recalcMethod · 0.80
appendMethod · 0.45
getInstanceMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected