Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1976 from radosuav/otb_double_quotes
[processing] avoid consecutive quotes when calling OTB algorithms
  • Loading branch information
alexbruy committed Apr 9, 2015
2 parents 33d973f + f94d92f commit c801c50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/otb/OTBUtils.py
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 c801c50

Please sign in to comment.