[bugfix] Thomas commit append an .in to every input file (e.g. pylot.in.in)

This commit is contained in:
Marcel Paffrath 2019-04-01 15:54:58 +02:00
parent a90ef26344
commit 0995350697

View File

@ -4219,13 +4219,15 @@ class PylotParaBox(QtGui.QWidget):
def saveFile(self):
fd = QtGui.QFileDialog()
fname = fd.getSaveFileName(self, 'Browse for settings file.',
filter='PyLoT input file (*.in)')
if fname[0]:
filter='PyLoT input file (*.in)')[0]
if fname:
if not fname.endswith('.in'):
fname += '.in'
try:
self.params_from_gui()
self.parameter.export2File(fname[0] + ".in")
self.parameter.export2File(fname)
except Exception as e:
self._warn('Could not save file {}:\n{}'.format(fname[0]+ ".in", e))
self._warn('Could not save file {}:\n{}'.format(fname, e))
return
def restoreDefaults(self):