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

Class FitListView

gui/fitBrowserLite.py:157–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155
156
157class FitListView(d.Display):
158
159 DEFAULT_COLS = ['Base Name']
160
161 def __init__(self, parent, **kwargs):
162 super().__init__(parent, style=wx.BORDER_NONE, **kwargs)
163 self.fits = []
164
165 def updateView(self):
166 self.update(self.fits)
167
168 def refreshView(self):
169 self.refresh(self.fits)
170
171 def updateData(self, fits):
172 self.fits = fits
173 self.updateView()
174
175 def addFits(self, fits):
176 for fit in fits:
177 if fit in self.fits:
178 continue
179 self.fits.append(fit)
180 self.fits.sort(key=fitSorter)
181 self.updateView()
182
183 def removeFits(self, fits):
184 for fit in fits:
185 if fit not in self.fits:
186 continue
187 self.fits.remove(fit)
188 self.updateView()
189
190 def GetSelectedFits(self):
191 fits = []
192 for row in self.getSelectedRows():
193 try:
194 fit = self.fits[row]
195 except IndexError:
196 continue
197 fits.append(fit)
198 return fits

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected