Commit 269eb548 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

bug log lines and not taken correctly

parent f5aff828
......@@ -81,8 +81,6 @@ def geoidFile():
def executeOtb(commands, feedback, addToLog=True):
loglines = []
#loglines.append(tr("OTB execution console output\n"))
fused_command = ''.join(['"%s" ' % re.sub(r'^"|"$', '', c) for c in commands])
with subprocess.Popen(
commands,
shell=True,
......@@ -100,20 +98,29 @@ def executeOtb(commands, feedback, addToLog=True):
try:
if int(s) >= 100:
feedback.pushConsoleInfo(line)
feedback.setProgress(int(s))
feedback.setProgress(int(s))
except:
pass
else:
line = line.strip()
if line != '/' and line != '-' and line != '\\' and line != '|':
loglines.append(line)
feedback.pushConsoleInfo(line)
except:
except BaseException as e:
loglines.append(str(e))
pass
if feedback is None:
QgsMessageLog.logMessage('\n'.join(loglines), 'Processing', Qgis.Info)
for logline in loglines:
if feedback is None:
QgsMessageLog.logMessage(logline, 'Processing', Qgis.Info)
else:
feedback.pushConsoleInfo(logline)
# for logline in loglines:
# if 'INFO' in logline or 'FATAL' in logline:
# if feedback is None:
# QgsMessageLog.logMessage(logline, 'Processing', Qgis.Info)
# else:
# feedback.pushConsoleInfo(logline)
def tr(string, context=''):
if context == '':
......
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