def backupToXml(self, event): """ Back up all fits to EVE XML file """ defaultFile = "pyfa-fits-%s.xml" % strftime("%Y%m%d_%H%M%S", gmtime()) saveDialog = wx.FileDialog( self, "Save Backup As...", wildcard="EVE XML fitting file (*.xml)|*.xml", style=wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT, defaultFile=defaultFile, ) if saveDialog.ShowModal() == wx.ID_OK: filePath = saveDialog.GetPath() if '.' not in os.path.basename(filePath): filePath += ".xml" sFit = Fit.getInstance() max_ = sFit.countAllFits() self.progressDialog = wx.ProgressDialog( "Backup fits", "Backing up %d fits to: %s" % (max_, filePath), maximum=max_, parent=self, style=wx.PD_CAN_ABORT | wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_APP_MODAL ) Port.backupFits(filePath, self) self.progressDialog.ShowModal()