From 580d69ea5e919c009ba6ebf5a4d265329c3cf818 Mon Sep 17 00:00:00 2001 From: Lucas Thode Date: Tue, 26 Oct 2010 09:01:04 -0500 Subject: [PATCH] moved some logic into the fit service --- gui/mainFrame.py | 6 +----- service/fit.py | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 08508a79a..82f319bf3 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -239,11 +239,7 @@ class MainFrame(wx.Frame): style = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) if (saveDialog.ShowModal() == wx.ID_OK): filePath = saveDialog.GetPath() - allFits = map(lambda x: x[0], sFit.getAllFits()) - backedUpFits = sFit.exportXml(*allFits) - backupFile = open(filePath, "w") - backupFile.write(backedUpFits) - backupFile.close() + sFit.backupFits(filePath) def toggleShipBrowser(self, event): self.GetToolBar().toggleShipBrowser(event) diff --git a/service/fit.py b/service/fit.py index 7893521ce..ebdf4c82a 100644 --- a/service/fit.py +++ b/service/fit.py @@ -335,6 +335,13 @@ class Fit(object): def exportXml(self, *fitIDs): fits = map(lambda id: eos.db.getFit(id), fitIDs) return eos.types.Fit.exportXml(*fits) + + def backupFits(self, path): + allFits = map(lambda x: x[0], self.getAllFits()) + backedUpFits = self.exportXml(*allFits) + backupFile = open(path, "w") + backupFile.write(backedUpFits) + backupFile.close() def importFit(self, path): f = file(path)