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

Method backupToXml

gui/mainFrame.py:858–883  ·  view source on GitHub ↗

Back up all fits to EVE XML file

(self, event)

Source from the content-addressed store, hash-verified

856 errMsgLbl=_t("Import Error"))
857
858 def backupToXml(self, event):
859 """ Back up all fits to EVE XML file """
860 defaultFile = "pyfa-fits-%s.xml" % strftime("%Y%m%d_%H%M%S", gmtime())
861
862 with wx.FileDialog(
863 self,
864 _t("Save Backup As..."),
865 wildcard=_t("EVE XML fitting file") + " (*.xml)|*.xml",
866 style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT,
867 defaultFile=defaultFile) as fileDlg:
868 if fileDlg.ShowModal() == wx.ID_OK:
869 filePath = fileDlg.GetPath()
870 if '.' not in os.path.basename(filePath):
871 filePath += ".xml"
872
873 fitAmount = Fit.getInstance().countAllFits()
874 progress = ProgressHelper(
875 message=_t("Backing up {} fits to: {}").format(fitAmount, filePath),
876 maximum=fitAmount + 1)
877 call = (Port.backupFits, [filePath, progress], {})
878 self.handleProgress(
879 title=_t("Backup fits"),
880 style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL | wx.PD_AUTO_HIDE,
881 call=call,
882 progress=progress,
883 errMsgLbl=_t("Export Error"))
884
885 def exportHtml(self, event):
886 from gui.utils.exportHtml import exportHtml

Callers

nothing calls this directly

Calls 5

handleProgressMethod · 0.95
ProgressHelperClass · 0.90
countAllFitsMethod · 0.80
_tFunction · 0.50
getInstanceMethod · 0.45

Tested by

no test coverage detected