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

Method display

gui/builtinContextMenus/droneAddStack.py:17–37  ·  view source on GitHub ↗
(self, callingWindow, srcContext, mainItem)

Source from the content-addressed store, hash-verified

15 self.mainFrame = gui.mainFrame.MainFrame.getInstance()
16
17 def display(self, callingWindow, srcContext, mainItem):
18 if srcContext not in ('marketItemGroup', 'marketItemMisc'):
19 return False
20
21 if self.mainFrame.getActiveFit() is None:
22 return False
23
24 if mainItem is None:
25 return False
26
27 if mainItem.category.name != 'Drone':
28 return False
29
30 fitID = self.mainFrame.getActiveFit()
31 fit = Fit.getInstance().getFit(fitID)
32 amount = droneStackLimit(fit, mainItem)
33 if amount < 1:
34 return False
35
36 self.amount = amount
37 return True
38
39 def getText(self, callingWindow, itmContext, mainItem):
40 return _t('Add {} to Drone Bay{}').format(

Callers

nothing calls this directly

Calls 4

droneStackLimitFunction · 0.90
getFitMethod · 0.80
getActiveFitMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected