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

Method getText

gui/builtinViewColumns/attributeDisplay.py:73–96  ·  view source on GitHub ↗
(self, mod)

Source from the content-addressed store, hash-verified

71 fittingView.refresh = refresh
72
73 def getText(self, mod):
74 if hasattr(mod, "item"):
75 attr = mod.getModifiedItemAttr(self.info.name, None)
76 else:
77 if self.direct:
78 info = self.directInfo
79 attr = info.get(mod.ID, "") if info else ""
80 else:
81 attr = mod.getAttribute(self.info.name)
82
83 if not attr:
84 return ""
85
86 if self.info.name == "volume":
87 if getattr(mod, "amount", 1) != 1:
88 attr = "{} m\u00B3 ({} m\u00B3)".format(
89 formatAmount(attr, 3, 0, 6),
90 formatAmount(attr * mod.amount, 3, 0, 6))
91 else:
92 attr = "{} m\u00B3".format(formatAmount(attr, 3, 0, 6))
93 if isinstance(attr, (float, int)):
94 attr = (formatAmount(attr, 3, 0, 3))
95
96 return attr
97
98 def getImageId(self, mod):
99 return -1

Callers

nothing calls this directly

Calls 4

formatAmountFunction · 0.90
getAttributeMethod · 0.80
getModifiedItemAttrMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected