Skip to content

Commit

Permalink
Fix invalid regular expression warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 31, 2017
1 parent 1037d47 commit 247d265
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ def selectFile(self):
filename = str(files[0]) filename = str(files[0])
selectedFileFilter = str(fileDialog.selectedNameFilter()) selectedFileFilter = str(fileDialog.selectedNameFilter())
if not filename.lower().endswith( if not filename.lower().endswith(
tuple(re.findall("\*(\.[a-z]{1,10})", fileFilter))): tuple(re.findall("\\*(\\.[a-z]{1,10})", fileFilter))):
ext = re.search("\*(\.[a-z]{1,10})", selectedFileFilter) ext = re.search("\\*(\\.[a-z]{1,10})", selectedFileFilter)
if ext: if ext:
filename = filename + ext.group(1) filename = filename + ext.group(1)
self.leOutputFile.setText(filename) self.leOutputFile.setText(filename)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/gui/BatchOutputSelectionPanel.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def showSelectionDialog(self):
self.tr('Save file'), path, filefilter) self.tr('Save file'), path, filefilter)
if filename: if filename:
if not filename.lower().endswith( if not filename.lower().endswith(
tuple(re.findall("\*(\.[a-z]{1,10})", filefilter))): tuple(re.findall("\\*(\\.[a-z]{1,10})", filefilter))):
ext = re.search("\*(\.[a-z]{1,10})", selectedFileFilter) ext = re.search("\\*(\\.[a-z]{1,10})", selectedFileFilter)
if ext: if ext:
filename += ext.group(1) filename += ext.group(1)
settings.setValue('/Processing/LastBatchOutputPath', os.path.dirname(filename)) settings.setValue('/Processing/LastBatchOutputPath', os.path.dirname(filename))
Expand Down

0 comments on commit 247d265

Please sign in to comment.