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

Method __init__

gui/builtinViewColumns/attributeDisplay.py:34–71  ·  view source on GitHub ↗
(self, fittingView, params)

Source from the content-addressed store, hash-verified

32 name = "attr"
33
34 def __init__(self, fittingView, params):
35 ViewColumn.__init__(self, fittingView)
36 sAttr = Attribute.getInstance()
37 info = sAttr.getAttributeInfo(params["attribute"])
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
45 iconType = "icons"
46 if iconFile:
47 self.imageId = fittingView.imageList.GetImageIndex(iconFile, iconType)
48 self.bitmap = BitmapLoader.getBitmap(iconFile, iconType)
49 else:
50 self.imageId = -1
51
52 self.mask = wx.LIST_MASK_IMAGE
53 else:
54 self.imageId = -1
55
56 if params["displayName"] or self.imageId == -1:
57 self.columnText = info.displayName if info.displayName != "" else info.name
58 self.mask |= wx.LIST_MASK_IMAGE
59
60 if params["direct"]:
61 self.direct = True
62 self.view = fittingView
63 originalRefresh = fittingView.refresh
64 sMkt = Market.getInstance()
65
66 def refresh(stuff):
67 # Hack into our master view and add a callback for ourselves to know when to query
68 self.directInfo = sMkt.directAttrRequest(stuff, info) if stuff else None
69 originalRefresh(stuff)
70
71 fittingView.refresh = refresh
72
73 def getText(self, mod):
74 if hasattr(mod, "item"):

Callers

nothing calls this directly

Calls 4

getAttributeInfoMethod · 0.80
GetImageIndexMethod · 0.80
getInstanceMethod · 0.45
getBitmapMethod · 0.45

Tested by

no test coverage detected