MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / getTabExtraText

Method getTabExtraText

gui/builtinAdditionPanes/fighterView.py:131–149  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

129 self.Refresh()
130
131 def getTabExtraText(self):
132 fitID = self.mainFrame.getActiveFit()
133 if fitID is None:
134 return None
135 sFit = Fit.getInstance()
136 fit = sFit.getFit(fitID)
137 if fit is None:
138 return None
139 opt = sFit.serviceFittingOptions["additionsLabels"]
140 # Amount of active fighter squads
141 if opt == 1:
142 amount = len([f for f in fit.fighters if f.active])
143 return ' ({})'.format(amount) if amount else None
144 # Total amount of fighter squads
145 elif opt == 2:
146 amount = len(fit.fighters)
147 return ' ({})'.format(amount) if amount else None
148 else:
149 return None
150
151
152class FighterDisplay(d.Display):

Callers

nothing calls this directly

Calls 3

getFitMethod · 0.80
getActiveFitMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected