Skip to content

Commit eea4eda

Browse files
committedFeb 10, 2019
osgeo4w: fix b6293f2 (fixes #21210)
1 parent 29d4496 commit eea4eda

File tree

11 files changed

+56
-22
lines changed

11 files changed

+56
-22
lines changed
 

‎python/plugins/processing/algs/gdal/AssignProjection.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,13 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
9292

9393
arguments.append(fileName)
9494

95-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
9695
if isWindows():
97-
commands.insert(0, 'python3')
96+
commands = ["python3", "-m", self.commandName()]
97+
else:
98+
commands = [self.commandName() + '.py']
99+
100+
commands.append(GdalUtils.escapeAndJoin(arguments))
98101

99102
self.setOutputValue(self.OUTPUT, fileName)
103+
100104
return commands

‎python/plugins/processing/algs/gdal/fillnodata.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
130130
arguments.append(raster.source())
131131
arguments.append(out)
132132

133-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
134133
if isWindows():
135-
commands.insert(0, 'python3')
134+
commands = ["python3", "-m", self.commandName()]
135+
else:
136+
commands = [self.commandName() + '.py']
137+
138+
commands.append(GdalUtils.escapeAndJoin(arguments))
136139

137140
return commands

‎python/plugins/processing/algs/gdal/gdal2tiles.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
229229
arguments.append(inLayer.source())
230230
arguments.append(self.parameterAsString(parameters, self.OUTPUT, context))
231231

232-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
233232
if isWindows():
234-
commands.insert(0, 'python3')
233+
commands = ["python3", "-m", self.commandName()]
234+
else:
235+
commands = [self.commandName() + '.py']
236+
237+
commands.append(GdalUtils.escapeAndJoin(arguments))
235238

236239
return commands

‎python/plugins/processing/algs/gdal/gdal2xyz.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
9494
arguments.append(raster.source())
9595
arguments.append(self.parameterAsFileOutput(parameters, self.OUTPUT, context))
9696

97-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
9897
if isWindows():
99-
commands.insert(0, 'python3')
98+
commands = ["python3", "-m", self.commandName()]
99+
else:
100+
commands = [self.commandName() + '.py']
101+
102+
commands.append(GdalUtils.escapeAndJoin(arguments))
100103

101104
return commands

‎python/plugins/processing/algs/gdal/merge.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
166166
arguments.append('--optfile')
167167
arguments.append(list_file)
168168

169-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
170169
if isWindows():
171-
commands.insert(0, 'python3')
170+
commands = ["python3", "-m", self.commandName()]
171+
else:
172+
commands = [self.commandName() + '.py']
173+
174+
commands.append(GdalUtils.escapeAndJoin(arguments))
172175

173176
return commands

‎python/plugins/processing/algs/gdal/pct2rgb.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
103103
if self.parameterAsBool(parameters, self.RGBA, context):
104104
arguments.append('-rgba')
105105

106-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
107106
if isWindows():
108-
commands.insert(0, 'python3')
107+
commands = ["python3", "-m", self.commandName()]
108+
else:
109+
commands = [self.commandName() + '.py']
110+
111+
commands.append(GdalUtils.escapeAndJoin(arguments))
109112

110113
return commands

‎python/plugins/processing/algs/gdal/polygonize.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
116116
arguments.append(layerName)
117117
arguments.append(self.parameterAsString(parameters, self.FIELD, context))
118118

119-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
120119
if isWindows():
121-
commands.insert(0, 'python3')
120+
commands = ["python3", "-m", self.commandName()]
121+
else:
122+
commands = [self.commandName() + '.py']
123+
124+
commands.append(GdalUtils.escapeAndJoin(arguments))
122125

123126
return commands

‎python/plugins/processing/algs/gdal/proximity.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
187187
arguments.append(inLayer.source())
188188
arguments.append(out)
189189

190-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
191190
if isWindows():
192-
commands.insert(0, 'python3')
191+
commands = ["python3", "-m", self.commandName()]
192+
else:
193+
commands = [self.commandName() + '.py']
194+
195+
commands.append(GdalUtils.escapeAndJoin(arguments))
193196

194197
return commands

‎python/plugins/processing/algs/gdal/retile.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
209209
layers = [l.source() for l in self.parameterAsLayerList(parameters, self.INPUT, context)]
210210
arguments.extend(layers)
211211

212-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
213212
if isWindows():
214-
commands.insert(0, 'python3')
213+
commands = ["python3", "-m", self.commandName()]
214+
else:
215+
commands = [self.commandName() + '.py']
216+
217+
commands.append(GdalUtils.escapeAndJoin(arguments))
215218

216219
return commands

‎python/plugins/processing/algs/gdal/rgb2pct.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
9595
arguments.append(raster.source())
9696
arguments.append(out)
9797

98-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
9998
if isWindows():
100-
commands.insert(0, 'python3')
99+
commands = ["python3", "-m", self.commandName()]
100+
else:
101+
commands = [self.commandName() + '.py']
102+
103+
commands.append(GdalUtils.escapeAndJoin(arguments))
101104

102105
return commands

‎python/plugins/processing/algs/gdal/sieve.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,11 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
120120
arguments.append(raster.source())
121121
arguments.append(out)
122122

123-
commands = [self.commandName() + '.py', GdalUtils.escapeAndJoin(arguments)]
124123
if isWindows():
125-
commands.insert(0, 'python3')
124+
commands = ["python3", "-m", self.commandName()]
125+
else:
126+
commands = [self.commandName() + '.py']
127+
128+
commands.append(GdalUtils.escapeAndJoin(arguments))
126129

127130
return commands

0 commit comments

Comments
 (0)