Skip to content
Permalink
Browse files

[processing] fixed adding extension to output filenames in batch inte…

…rface

fixes #10444
  • Loading branch information
volaya committed Oct 1, 2015
1 parent a9dab06 commit 7f061d2d75e549a72efe8626b7ed9d31ee982ccd
Showing with 9 additions and 3 deletions.
  1. +9 −3 python/plugins/processing/gui/BatchOutputSelectionPanel.py
@@ -16,6 +16,7 @@
* *
***************************************************************************
"""
import re

__author__ = 'Victor Olaya'
__date__ = 'August 2012'
@@ -77,10 +78,15 @@ def showSelectionDialog(self):
path = unicode(settings.value('/Processing/LastBatchOutputPath'))
else:
path = ''
filename = QFileDialog.getSaveFileName(self, self.tr('Save file'), path,
filefilter)
filename, selectedFileFilter = QFileDialog.getSaveFileNameAndFilter(self,
self.tr('Save file'), path, filefilter)
print filename, selectedFileFilter
if filename:
filename = unicode(filename)
if not filename.lower().endswith(
tuple(re.findall("\*(\.[a-z]{1,10})", filefilter))):
ext = re.search("\*(\.[a-z]{1,10})", selectedFileFilter)
if ext:
filename += ext.group(1)
settings.setValue('/Processing/LastBatchOutputPath', os.path.dirname(filename))
dlg = AutofillDialog(self.alg)
dlg.exec_()

0 comments on commit 7f061d2

Please sign in to comment.
You can’t perform that action at this time.