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

Method __init__

gui/builtinViewColumns/propertyDisplay.py:28–54  ·  view source on GitHub ↗
(self, fittingView, params)

Source from the content-addressed store, hash-verified

26 name = "prop"
27
28 def __init__(self, fittingView, params):
29 ViewColumn.__init__(self, fittingView)
30 sAttr = Attribute.getInstance()
31 attributeSlave = params["attributeSlave"] or params["property"]
32 # This function can throw an exception if the database isn't sane
33 # We need to do a sanity check before this runs
34 info = sAttr.getAttributeInfo(attributeSlave)
35
36 self.mask = 0
37 self.propertyName = params["property"]
38 self.info = info
39 if params["showIcon"]:
40 if info.name == "power":
41 iconFile = "pg_small"
42 iconType = "gui"
43 else:
44 iconFile = info.iconID if info.icon else None
45 iconType = "icons"
46 if iconFile:
47 self.imageId = fittingView.imageList.GetImageIndex(iconFile, iconType)
48 else:
49 self.imageId = -1
50 else:
51 self.imageId = -1
52
53 if params["displayName"] or self.imageId == -1:
54 self.columnText = info.displayName if info.displayName != "" else info.name
55
56 def getText(self, stuff):
57 attr = getattr(stuff, self.propertyName, None)

Callers

nothing calls this directly

Calls 3

getAttributeInfoMethod · 0.80
GetImageIndexMethod · 0.80
getInstanceMethod · 0.45

Tested by

no test coverage detected