Skip to content

Commit

Permalink
[processing] fix substitution of the original layers in GDAL commands
Browse files Browse the repository at this point in the history
(cherry picked from commit 89774ab)

Conflicts:
	python/plugins/processing/algs/gdal/GdalAlgorithm.py
  • Loading branch information
alexbruy committed Sep 14, 2016
1 parent 342be6f commit e805f00
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/processing/algs/gdal/GdalAlgorithm.py
Expand Up @@ -28,6 +28,7 @@
__revision__ = '$Format:%H$'

import os
import re

from qgis.PyQt.QtGui import QIcon

Expand Down Expand Up @@ -59,7 +60,9 @@ def processAlgorithm(self, progress):
c = c.replace(layer.source(), exported)
if os.path.isfile(layer.source()):
fileName = os.path.splitext(os.path.split(layer.source())[1])[0]
c = c.replace(fileName, exportedFileName)
c = re.sub('[\s]{}[\s]'.format(fileName), ' ' + exportedFileName + ' ', c)
c = re.sub('[\s]{}'.format(fileName), ' ' + exportedFileName, c)
c = re.sub('["\']{}["\']'.format(fileName), "'" + exportedFileName + "'", c)

commands[i] = c
GdalUtils.runGdal(commands, progress)
Expand Down

0 comments on commit e805f00

Please sign in to comment.