Skip to content

Commit f94d92f

Browse files
author
radosuav
committedApr 7, 2015
[Processing] Avoid consecutive quotes when calling OTB algorithms.
1 parent 12d7cfc commit f94d92f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎python/plugins/processing/algs/otb/OTBUtils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
__revision__ = '$Format:%H$'
3030

3131
import os
32+
import re
3233
from PyQt4.QtCore import QCoreApplication
3334
from qgis.core import QgsApplication
3435
import subprocess
@@ -130,7 +131,7 @@ def executeOtb(commands, progress):
130131
loglines = []
131132
loglines.append(OTBUtils.tr("OTB execution console output"))
132133
os.putenv('ITK_AUTOLOAD_PATH', OTBUtils.otbLibPath())
133-
fused_command = ''.join(['"%s" ' % c for c in commands])
134+
fused_command = ''.join(['"%s" ' % re.sub(r'^"|"$', '', c) for c in commands])
134135
proc = subprocess.Popen(fused_command, shell=True, stdout=subprocess.PIPE, stdin=open(os.devnull),stderr=subprocess.STDOUT, universal_newlines=True).stdout
135136
for line in iter(proc.readline, ""):
136137
if "[*" in line:

0 commit comments

Comments
 (0)
Please sign in to comment.