Skip to content

Commit

Permalink
Auto add file type suffix if missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Godrigos committed Oct 16, 2018
1 parent fd5274b commit 396f0ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion msaj.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ def report(self):
def save_file(self):
options = QFileDialog.Options()
self.filename = QFileDialog.getSaveFileName(self, "Save File", str(Path.home()),
"NEXUS Files (*.nex *.nexus *.nxs)", options=options)[0] + '.nex'
"NEXUS Files (*.nex *.nexus *.nxs)", options=options)[0]
if QFileInfo(self.filename).suffix() != ('.nex' and '.nexus') and basename(splitext(self.filename)[0]) != '':
self.filename += '.nex'
return self.filename

def msaj(self):
Expand Down

0 comments on commit 396f0ba

Please sign in to comment.