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

Method GetData

gui/builtinItemStatsViews/itemAttributes.py:291–361  ·  view source on GitHub ↗
(self, attr, displayOveride=None)

Source from the content-addressed store, hash-verified

289 self.paramList.SetColumnWidth(i, wx.LIST_AUTOSIZE)
290
291 def GetData(self, attr, displayOveride=None):
292 info = self.attrInfo.get(attr)
293 att = self.attrValues[attr]
294
295 # If we're working with a stuff object, we should get the original value from our getItemBaseAttrValue function,
296 # which will return the value with respect to the effective base (with mutators / overrides in place)
297 valDefault = getattr(info, "value", None) # Get default value from attribute
298 if self.stuff is not None:
299 # if it's a stuff, overwrite default (with fallback to current value)
300 if self.isStuffItem:
301 valDefault = self.stuff.getItemBaseAttrValue(attr, valDefault)
302 elif self.isStuffCharge:
303 valDefault = self.stuff.getChargeBaseAttrValue(attr, valDefault)
304
305 valueDefault = valDefault if valDefault is not None else att
306
307 val = getattr(att, "value", None)
308 value = val if val is not None else att
309
310 if self.toggleView == AttributeView.NORMAL and (
311 (attr not in GroupedAttributes and not (value or valueDefault)) or info is None or not info.published or attr in RequiredSkillAttrs):
312 return None
313
314 if info and info.displayName and self.toggleView == AttributeView.NORMAL:
315 attrName = displayOveride or info.displayName
316 else:
317 attrName = attr
318
319 if info and config.debug:
320 attrName += " ({})".format(info.ID)
321
322 if info:
323 if info.iconID is not None:
324 iconFile = info.iconID
325 icon = BitmapLoader.getBitmap(iconFile, "icons")
326
327 if icon is None:
328 attrIcon = self.blank_icon
329 else:
330 attrIcon = self.imageList.Add(icon)
331 else:
332 attrIcon = self.unknown_icon
333 else:
334 attrIcon = self.unknown_icon
335
336 # index = self.paramList.AppendItem(root, attrName)
337 # idNameMap[idCount] = attrName
338 # self.paramList.SetPyData(index, idCount)
339 # idCount += 1
340
341 if self.toggleView == AttributeView.RAW:
342 valueUnit = str(value)
343 elif info and info.unit:
344 valueUnit = self.FormatValue(*info.unit.PreformatValue(value))
345 else:
346 valueUnit = formatAmount(value, 3, 0, 0)
347
348 if self.toggleView == AttributeView.RAW:

Callers 10

AddAttributeMethod · 0.95
fromClipboardFunction · 0.80
OnDataMethod · 0.80
OnDataMethod · 0.80
OnDataMethod · 0.80
OnDataMethod · 0.80
OnDataMethod · 0.80
OnDataMethod · 0.80
OnDataMethod · 0.80
OnDataMethod · 0.80

Calls 7

FormatValueMethod · 0.95
formatAmountFunction · 0.90
getItemBaseAttrValueMethod · 0.80
PreformatValueMethod · 0.80
getMethod · 0.45
getBitmapMethod · 0.45

Tested by

no test coverage detected