Commit 5c40d6d8 authored by Rashad Kanavath's avatar Rashad Kanavath

allow filenamewithspaces to otb applications

parent 85aa3d8b
......@@ -165,7 +165,7 @@ class OtbAlgorithmProvider(QgsProcessingProvider):
gdal_data_dir = os.path.join(otb_folder, 'share', 'data')
geotiff_csv_dir = os.path.join(otb_folder, 'share', 'epsg_csv')
else:
app_vargs = " $@"
app_vargs = " \"$@\""
export_cmd = 'export '
first_line = '#!/bin/sh'
otb_app_launcher = os.path.join(otb_folder, 'bin', 'otbApplicationLauncherCommandLine')
......@@ -191,10 +191,10 @@ class OtbAlgorithmProvider(QgsProcessingProvider):
if geotiff_csv_dir:
otb_cli_file.write(export_cmd + "GEOTIFF_CSV=" + "\"" + geotiff_csv_dir + "\"" + os.linesep)
if OtbUtils.loggerLevel():
otb_cli_file.write(export_cmd + "OTB_LOGGER_LEVEL=" + "\"" + OtbUtils.loggerLevel() + "\"" + os.linesep)
otb_cli_file.write(export_cmd + "OTB_LOGGER_LEVEL=" + OtbUtils.loggerLevel() + os.linesep)
max_ram_hint = OtbUtils.maxRAMHint()
if max_ram_hint and not int(max_ram_hint) == 128 :
otb_cli_file.write(export_cmd + "OTB_MAX_RAM_HINT=" + "\"" + max_ram_hint + "\"" + os.linesep)
otb_cli_file.write(export_cmd + "OTB_MAX_RAM_HINT=" + max_ram_hint + os.linesep)
otb_cli_file.write(export_cmd + "OTB_APPLICATION_PATH=" + "\"" + otb_app_path_env + "\"" + os.linesep)
otb_cli_file.write("\"" + otb_app_launcher + "\"" + app_vargs + os.linesep)
......
......@@ -71,11 +71,11 @@ def srtmFolder():
def geoidFile():
return ProcessingConfig.getSetting(OtbSettings.GEOID_FILE) or ''
def executeOtb(commands, feedback, addToLog=True):
def executeOtb(command, feedback, addToLog=True):
loglines = []
feedback.setProgress(0)
with subprocess.Popen(
commands,
[command],
shell=True,
stdout=subprocess.PIPE,
stdin=subprocess.DEVNULL,
......@@ -119,3 +119,4 @@ def tr(string, context=''):
if context == '':
context = 'OtbUtils'
return QCoreApplication.translate(context, string)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment