moved some logic into the fit service
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user