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

Method refreshCharacterList

gui/characterSelection.py:134–161  ·  view source on GitHub ↗
(self, event=None)

Source from the content-addressed store, hash-verified

132 return self.charChoice.GetClientData(selection) if selection != -1 else None
133
134 def refreshCharacterList(self, event=None):
135 choice = self.charChoice
136 sChar = Character.getInstance()
137 activeChar = self.getActiveCharacter()
138
139 choice.Clear()
140 charList = sorted(sChar.getCharacterList(), key=lambda c: (not c.ro, c.name))
141 picked = False
142
143 for char in charList:
144 currId = choice.Append(char.name, char.ID)
145 if char.ID == activeChar:
146 choice.SetSelection(currId)
147 self.charChanged(None)
148 picked = True
149
150 if not picked:
151 charID = sChar.all5ID()
152 self.selectChar(charID)
153 fitID = self.mainFrame.getActiveFit()
154 sFit = Fit.getInstance()
155 sFit.changeChar(fitID, charID)
156
157 choice.Append("\u2015 " + _t("Open Character Editor") + " \u2015", -1)
158 self.charCache = self.charChoice.GetCurrentSelection()
159
160 if event is not None:
161 event.Skip()
162
163 def refreshApi(self, event):
164 self.btnRefresh.Enable(False)

Callers 3

__init__Method · 0.95
grantMissingSkillsMethod · 0.95
refreshAPICallbackMethod · 0.95

Calls 11

getActiveCharacterMethod · 0.95
charChangedMethod · 0.95
selectCharMethod · 0.95
getCharacterListMethod · 0.80
SetSelectionMethod · 0.80
all5IDMethod · 0.80
changeCharMethod · 0.80
_tFunction · 0.50
getInstanceMethod · 0.45
ClearMethod · 0.45
getActiveFitMethod · 0.45

Tested by

no test coverage detected