Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
osgeo4w: fix b6293f2 (fixes #21210)
(cherry picked from commit eea4eda)
  • Loading branch information
jef-n authored and nyalldawson committed Feb 11, 2019
1 parent 8b8e6b8 commit 69e5415
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 22 deletions.
8 changes: 6 additions & 2 deletions python/plugins/processing/algs/gdal/AssignProjection.py
Expand Up @@ -92,9 +92,13 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):

arguments.append(fileName)

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

self.setOutputValue(self.OUTPUT, fileName)

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/fillnodata.py
Expand Up @@ -130,8 +130,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(raster.source())
arguments.append(out)

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/gdal2tiles.py
Expand Up @@ -229,8 +229,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(inLayer.source())
arguments.append(self.parameterAsString(parameters, self.OUTPUT, context))

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/gdal2xyz.py
Expand Up @@ -94,8 +94,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(raster.source())
arguments.append(self.parameterAsFileOutput(parameters, self.OUTPUT, context))

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/merge.py
Expand Up @@ -166,8 +166,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append('--optfile')
arguments.append(list_file)

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/pct2rgb.py
Expand Up @@ -103,8 +103,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
if self.parameterAsBool(parameters, self.RGBA, context):
arguments.append('-rgba')

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/polygonize.py
Expand Up @@ -116,8 +116,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(layerName)
arguments.append(self.parameterAsString(parameters, self.FIELD, context))

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/proximity.py
Expand Up @@ -187,8 +187,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(inLayer.source())
arguments.append(out)

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/retile.py
Expand Up @@ -209,8 +209,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
layers = [l.source() for l in self.parameterAsLayerList(parameters, self.INPUT, context)]
arguments.extend(layers)

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/rgb2pct.py
Expand Up @@ -95,8 +95,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(raster.source())
arguments.append(out)

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands
7 changes: 5 additions & 2 deletions python/plugins/processing/algs/gdal/sieve.py
Expand Up @@ -120,8 +120,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(raster.source())
arguments.append(out)

commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
if isWindows():
commands.insert(0, 'python3')
commands = ["python3", "-m", self.commandName()]
else:
commands = [self.commandName() + '.py']

commands.append(GdalUtils.escapeAndJoin(arguments))

return commands

0 comments on commit 69e5415

Please sign in to comment.