Skip to content

Commit f1bb580

Browse files
committed
[processing] Fix exception on completion of batch execution of
algorithm which has string or numeric outputs
1 parent 1c86308 commit f1bb580

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

python/plugins/processing/gui/BatchAlgorithmDialog.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def runAlgorithm(self):
8989
if not param.checkValueIsAcceptable(wrapper.parameterValue()):
9090
self.messageBar().pushMessage("", self.tr('Wrong or missing parameter value: {0} (row {1})').format(
9191
param.description(), row + 1),
92-
level=Qgis.Warning, duration=5)
92+
level=Qgis.Warning, duration=5)
9393
return
9494
col += 1
9595
count_visible_outputs = 0
@@ -112,7 +112,7 @@ def runAlgorithm(self):
112112
else:
113113
self.messageBar().pushMessage("", self.tr('Wrong or missing output value: {0} (row {1})').format(
114114
out.description(), row + 1),
115-
level=Qgis.Warning, duration=5)
115+
level=Qgis.Warning, duration=5)
116116
return
117117

118118
alg_parameters.append(parameters)
@@ -139,8 +139,11 @@ def runAlgorithm(self):
139139
for count, parameters in enumerate(alg_parameters):
140140
if feedback.isCanceled():
141141
break
142-
self.setProgressText(QCoreApplication.translate('BatchAlgorithmDialog', '\nProcessing algorithm {0}/{1}…').format(count + 1, len(alg_parameters)))
143-
self.setInfo(self.tr('<b>Algorithm {0} starting&hellip;</b>').format(self.algorithm().displayName()), escapeHtml=False)
142+
self.setProgressText(
143+
QCoreApplication.translate('BatchAlgorithmDialog', '\nProcessing algorithm {0}/{1}…').format(
144+
count + 1, len(alg_parameters)))
145+
self.setInfo(self.tr('<b>Algorithm {0} starting&hellip;</b>').format(self.algorithm().displayName()),
146+
escapeHtml=False)
144147
multi_feedback.setCurrentStep(count)
145148

146149
parameters = self.algorithm().preprocessParameters(parameters)
@@ -158,7 +161,9 @@ def runAlgorithm(self):
158161
alg_start_time = time.time()
159162
ret, results = execute(self.algorithm(), parameters, context, multi_feedback)
160163
if ret:
161-
self.setInfo(QCoreApplication.translate('BatchAlgorithmDialog', 'Algorithm {0} correctly executed…').format(self.algorithm().displayName()), escapeHtml=False)
164+
self.setInfo(
165+
QCoreApplication.translate('BatchAlgorithmDialog', 'Algorithm {0} correctly executed…').format(
166+
self.algorithm().displayName()), escapeHtml=False)
162167
feedback.pushInfo(
163168
self.tr('Execution completed in {0:0.2f} seconds'.format(time.time() - alg_start_time)))
164169
feedback.pushInfo(self.tr('Results:'))
@@ -209,5 +214,6 @@ def createSummaryTable(self, algorithm_results):
209214
f.write('<p>{}: {}</p>\n'.format(out.description(), res[out.name()]))
210215
f.write('<hr>\n')
211216

212-
resultsList.addResult(self.algorithm().icon(),
213-
'{} [summary]'.format(self.algorithm().name()), outputFile)
217+
resultsList.addResult(icon=self.algorithm().icon(),
218+
name='{} [summary]'.format(self.algorithm().name()), timestamp=time.localtime(),
219+
result=outputFile)

0 commit comments

Comments
 (0)