osgeo4w: fix b6293f23c8c (fixes #21210)

This commit is contained in:
Juergen E. Fischer 2019-02-10 21:06:56 +01:00
parent 29d4496452
commit eea4eda6a3
11 changed files with 56 additions and 22 deletions

View File

@ -92,9 +92,13 @@ class AssignProjection(GdalAlgorithm):
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

View File

@ -130,8 +130,11 @@ class fillnodata(GdalAlgorithm):
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

View File

@ -229,8 +229,11 @@ class gdal2tiles(GdalAlgorithm):
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

View File

@ -94,8 +94,11 @@ class gdal2xyz(GdalAlgorithm):
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

View File

@ -166,8 +166,11 @@ class merge(GdalAlgorithm):
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

View File

@ -103,8 +103,11 @@ class pct2rgb(GdalAlgorithm):
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

View File

@ -116,8 +116,11 @@ class polygonize(GdalAlgorithm):
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

View File

@ -187,8 +187,11 @@ class proximity(GdalAlgorithm):
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

View File

@ -209,8 +209,11 @@ class retile(GdalAlgorithm):
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

View File

@ -95,8 +95,11 @@ class rgb2pct(GdalAlgorithm):
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

View File

@ -120,8 +120,11 @@ class sieve(GdalAlgorithm):
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