mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -04:00
Minor cleanup in processing plugin python code
This commit is contained in:
parent
0503771bf1
commit
1ddc5ad90c
@ -444,16 +444,17 @@ class ProcessingPlugin(QObject):
|
||||
.createAlgorithmById(alg_id, config)
|
||||
)
|
||||
|
||||
if alg is not None:
|
||||
if not alg:
|
||||
return
|
||||
|
||||
ok, message = alg.canExecute()
|
||||
if not ok:
|
||||
dlg = MessageDialog()
|
||||
dlg.setTitle(self.tr("Error executing algorithm"))
|
||||
dlg.setMessage(
|
||||
self.tr(
|
||||
"<h3>This algorithm cannot " "be run :-( </h3>\n{0}"
|
||||
).format(message)
|
||||
self.tr("<h3>This algorithm cannot " "be run :-( </h3>\n{0}").format(
|
||||
message
|
||||
)
|
||||
)
|
||||
dlg.exec()
|
||||
return
|
||||
@ -462,7 +463,8 @@ class ProcessingPlugin(QObject):
|
||||
dlg = BatchAlgorithmDialog(alg, iface.mainWindow())
|
||||
dlg.show()
|
||||
dlg.exec()
|
||||
else:
|
||||
return
|
||||
|
||||
in_place_input_parameter_name = "INPUT"
|
||||
if hasattr(alg, "inputParameterName"):
|
||||
in_place_input_parameter_name = alg.inputParameterName()
|
||||
|
@ -114,7 +114,9 @@ class AlgorithmLocatorFilter(QgsLocatorFilter):
|
||||
|
||||
def triggerResult(self, result):
|
||||
alg = QgsApplication.processingRegistry().createAlgorithmById(result.userData)
|
||||
if alg:
|
||||
if not alg:
|
||||
return
|
||||
|
||||
ok, message = alg.canExecute()
|
||||
if not ok:
|
||||
dlg = MessageDialog()
|
||||
@ -221,7 +223,9 @@ class InPlaceAlgorithmLocatorFilter(QgsLocatorFilter):
|
||||
alg = QgsApplication.processingRegistry().createAlgorithmById(
|
||||
result.userData, config
|
||||
)
|
||||
if alg:
|
||||
if not alg:
|
||||
return
|
||||
|
||||
ok, message = alg.canExecute()
|
||||
if not ok:
|
||||
dlg = MessageDialog()
|
||||
|
Loading…
x
Reference in New Issue
Block a user