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

Method LoadPreviousOpenFits

gui/mainFrame.py:248–272  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

246 dlg.ShowModal()
247
248 def LoadPreviousOpenFits(self):
249 sFit = Fit.getInstance()
250
251 self.prevOpenFits = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
252 {"enabled": False, "pyfaOpenFits": []})
253 fits = self.prevOpenFits['pyfaOpenFits']
254
255 # Remove any fits that cause exception when fetching (non-existent fits)
256 for id in fits[:]:
257 try:
258 fit = sFit.getFit(id, basic=True)
259 if fit is None:
260 fits.remove(id)
261 except (KeyboardInterrupt, SystemExit):
262 raise
263 except:
264 fits.remove(id)
265
266 if not self.prevOpenFits['enabled'] or len(fits) == 0:
267 # add blank page if there are no fits to be loaded
268 self.fitMultiSwitch.AddPage()
269 return
270
271 self.waitDialog = wx.BusyInfo(_t("Loading previous fits..."), parent=self)
272 OpenFitsThread(fits, self.closeWaitDialog)
273
274 def _getDisplayData(self):
275 displayData = []

Callers 1

__init__Method · 0.95

Calls 7

OpenFitsThreadClass · 0.85
getSettingsMethod · 0.80
getFitMethod · 0.80
_tFunction · 0.50
getInstanceMethod · 0.45
removeMethod · 0.45
AddPageMethod · 0.45

Tested by

no test coverage detected