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

Method getText

gui/builtinViewColumns/targetResists.py:41–63  ·  view source on GitHub ↗
(self, stuff)

Source from the content-addressed store, hash-verified

39 self.mask = wx.LIST_MASK_TEXT
40
41 def getText(self, stuff):
42 if isinstance(stuff, TargetWrapper):
43 em, therm, kin, explo, layer = stuff.getResists(includeLayer=True)
44 if stuff.isFit:
45 modeSuffixMap = {
46 TargetResistMode.auto: 'auto',
47 TargetResistMode.shield: 'shield',
48 TargetResistMode.armor: 'armor',
49 TargetResistMode.hull: 'hull',
50 TargetResistMode.weightedAverage: 'average'}
51 modeSuffix = modeSuffixMap[stuff.resistMode]
52 if stuff.resistMode == TargetResistMode.auto and layer is not None:
53 modeSuffix = '{} {}'.format(modeSuffix, layer)
54 modeSuffix = ' ({})'.format(modeSuffix)
55 else:
56 modeSuffix = ''
57 return '{}/{}/{}/{}{}'.format(
58 formatAmount(val=em * 100, prec=3, lowest=0, highest=0),
59 formatAmount(val=therm * 100, prec=3, lowest=0, highest=0),
60 formatAmount(val=kin * 100, prec=3, lowest=0, highest=0),
61 formatAmount(val=explo * 100, prec=3, lowest=0, highest=0),
62 modeSuffix)
63 return ''
64
65 def getToolTip(self, mod):
66 return 'Target resistances\nEM / Thermal / Kinetic / Explosive'

Callers

nothing calls this directly

Calls 2

formatAmountFunction · 0.90
getResistsMethod · 0.80

Tested by

no test coverage detected