MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / jump

Method jump

gui/builtinMarketBrowser/marketTree.py:86–110  ·  view source on GitHub ↗

Open market group and meta tab of given item

(self, item)

Source from the content-addressed store, hash-verified

84 event.Skip()
85
86 def jump(self, item):
87 """Open market group and meta tab of given item"""
88 sMkt = self.sMkt
89 mg = sMkt.getMarketGroupByItem(item)
90
91 jumpList = []
92 while mg is not None:
93 jumpList.append(mg.ID)
94 mg = mg.parent
95
96 for id in sMkt.ROOT_MARKET_GROUPS:
97 if id in jumpList:
98 jumpList = jumpList[:jumpList.index(id) + 1]
99
100 item = self.root
101 for i in range(len(jumpList) - 1, -1, -1):
102 target = jumpList[i]
103 child, cookie = self.GetFirstChild(item)
104 while self.GetItemData(child) != target:
105 child, cookie = self.GetNextChild(item, cookie)
106
107 item = child
108 self.Expand(item)
109
110 self.SelectItem(item)

Callers 1

activateMethod · 0.45

Calls 2

getMarketGroupByItemMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected