mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[Processing] Fix when iface is None
This commit is contained in:
parent
46ff59bbfe
commit
e765bb6dd1
@ -386,7 +386,8 @@ class GeoAlgorithm:
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
self.crs = iface.mapCanvas().mapSettings().destinationCrs()
|
if iface is not None:
|
||||||
|
self.crs = iface.mapCanvas().mapSettings().destinationCrs()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -385,9 +385,10 @@ class ModelerAlgorithm(GeoAlgorithm):
|
|||||||
if param.name in alg.params:
|
if param.name in alg.params:
|
||||||
value = self.resolveValue(alg.params[param.name])
|
value = self.resolveValue(alg.params[param.name])
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage(self.tr("Warning"),
|
if iface is not None:
|
||||||
self.tr("Parameter %s in algorithm %s in the model is run with default value! Edit the model to make sure that this is correct.") % (param.name, alg.name),
|
iface.messageBar().pushMessage(self.tr("Warning"),
|
||||||
QgsMessageBar.WARNING, 4)
|
self.tr("Parameter %s in algorithm %s in the model is run with default value! Edit the model to make sure that this is correct.") % (param.name, alg.name),
|
||||||
|
QgsMessageBar.WARNING, 4)
|
||||||
value = None
|
value = None
|
||||||
if value is None and isinstance(param, ParameterExtent):
|
if value is None and isinstance(param, ParameterExtent):
|
||||||
value = self.getMinCoveringExtent()
|
value = self.getMinCoveringExtent()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user