Skip to content

Commit

Permalink
[Processing] Avoid consecutive quotes when calling OTB algorithms.
Browse files Browse the repository at this point in the history
  • Loading branch information
radosuav committed Apr 7, 2015
1 parent 12d7cfc commit f94d92f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/otb/OTBUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
__revision__ = '$Format:%H$'

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

0 comments on commit f94d92f

Please sign in to comment.