From 0995350697baf68dde77ce88e8a983891c08d24c Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 1 Apr 2019 15:54:58 +0200 Subject: [PATCH] [bugfix] Thomas commit append an .in to every input file (e.g. pylot.in.in) --- pylot/core/util/widgets.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 0c386d77..9954e637 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -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):