diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 35339c98e..c3f5a2baa 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -253,13 +253,14 @@ class MainFrame(wx.Frame): wildcard = "EFT text fitting files (*.cfg)|*.cfg|EvE XML fitting files (*.xml)|*.xml|All Files (*)|*", style = wx.FD_OPEN | wx.FD_FILE_MUST_EXIST | wx.FD_MULTIPLE) if (dlg.ShowModal() == wx.ID_OK): - try: - for importPath in dlg.GetPaths(): - fits += sFit.importFit(importPath) - IDs = sFit.saveImportedFits(fits) - self._openAfterImport(len(fits), IDs) - except: - wx.MessageBox("Error importing from file.", "Error", wx.OK | wx.ICON_ERROR, self) +# try: + for importPath in dlg.GetPaths(): + fits += sFit.importFit(importPath) + print fits + IDs = sFit.saveImportedFits(fits) + self._openAfterImport(len(fits), IDs) +# except: +# wx.MessageBox("Error importing from file.", "Error", wx.OK | wx.ICON_ERROR, self) dlg.Destroy() def _openAfterImport(self, importCount, fitIDs): diff --git a/service/fit.py b/service/fit.py index a2c62d783..cb6ebbf9f 100644 --- a/service/fit.py +++ b/service/fit.py @@ -25,6 +25,7 @@ from service.damagePattern import DamagePattern from service.character import Character import threading import wx +import os.path class FitBackupThread(threading.Thread): def __init__(self, path, callback): @@ -508,8 +509,10 @@ class Fit(object): thread.start() def importFit(self, path): + filename = os.path.split(path)[1] + f = file(path) - type, fits = eos.types.Fit.importAuto(f.read()) + type, fits = eos.types.Fit.importAuto(f.read(), filename) return fits