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

Method getTabExtraText

gui/builtinAdditionPanes/projectedView.py:404–433  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

402 amount=1))
403
404 def getTabExtraText(self):
405 fitID = self.mainFrame.getActiveFit()
406 if fitID is None:
407 return None
408 sFit = Fit.getInstance()
409 fit = sFit.getFit(fitID)
410 if fit is None:
411 return None
412 opt = sFit.serviceFittingOptions["additionsLabels"]
413 # Amount of active projected items
414 if opt == 1:
415 amount = 0
416 for projectedFit in fit.projectedFits:
417 info = projectedFit.getProjectionInfo(fitID)
418 if info is not None and info.active:
419 amount += 1
420 amount += len([m for m in fit.projectedModules if m.state > FittingModuleState.OFFLINE])
421 amount += len([d for d in fit.projectedDrones if d.amountActive > 0])
422 amount += len([f for f in fit.projectedFighters if f.active])
423 return ' ({})'.format(amount) if amount else None
424 # Total amount of projected items
425 elif opt == 2:
426 amount = 0
427 amount += len(fit.projectedFits)
428 amount += len(fit.projectedModules)
429 amount += len(fit.projectedDrones)
430 amount += len(fit.projectedFighters)
431 return ' ({})'.format(amount) if amount else None
432 else:
433 return None

Callers

nothing calls this directly

Calls 4

getFitMethod · 0.80
getProjectionInfoMethod · 0.80
getActiveFitMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected