mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Indentation
This commit is contained in:
parent
1a4a654f8b
commit
459244126f
@ -18,7 +18,6 @@
|
|||||||
"""
|
"""
|
||||||
from builtins import str
|
from builtins import str
|
||||||
|
|
||||||
|
|
||||||
__author__ = 'Victor Olaya'
|
__author__ = 'Victor Olaya'
|
||||||
__date__ = 'August 2012'
|
__date__ = 'August 2012'
|
||||||
__copyright__ = '(C) 2012, Victor Olaya'
|
__copyright__ = '(C) 2012, Victor Olaya'
|
||||||
@ -55,7 +54,6 @@ from processing.core.parameters import ParameterPoint, ParameterExtent
|
|||||||
|
|
||||||
|
|
||||||
class ModelerParametersDialog(QDialog):
|
class ModelerParametersDialog(QDialog):
|
||||||
|
|
||||||
ENTER_NAME = '[Enter name if this is a final result]'
|
ENTER_NAME = '[Enter name if this is a final result]'
|
||||||
NOT_SELECTED = '[Not selected]'
|
NOT_SELECTED = '[Not selected]'
|
||||||
USE_MIN_COVERING_EXTENT = '[Use min covering extent]'
|
USE_MIN_COVERING_EXTENT = '[Use min covering extent]'
|
||||||
@ -151,7 +149,7 @@ class ModelerParametersDialog(QDialog):
|
|||||||
self.verticalLayout.addWidget(label)
|
self.verticalLayout.addWidget(label)
|
||||||
self.verticalLayout.addWidget(widget)
|
self.verticalLayout.addWidget(widget)
|
||||||
|
|
||||||
#for output in self._alg.outputs:
|
# for output in self._alg.outputs:
|
||||||
# if output.flags() & QgsProcessingParameterDefinition.FlagHidden:
|
# if output.flags() & QgsProcessingParameterDefinition.FlagHidden:
|
||||||
# continue
|
# continue
|
||||||
# if isinstance(output, (OutputRaster, OutputVector, OutputTable,
|
# if isinstance(output, (OutputRaster, OutputVector, OutputTable,
|
||||||
@ -241,7 +239,8 @@ class ModelerParametersDialog(QDialog):
|
|||||||
if isinstance(param, t):
|
if isinstance(param, t):
|
||||||
if dataType is not None:
|
if dataType is not None:
|
||||||
if param.datatype in dataType:
|
if param.datatype in dataType:
|
||||||
values.append(QgsProcessingModelAlgorithm.ChildParameterSource.fromModelParameter(param.name()))
|
values.append(
|
||||||
|
QgsProcessingModelAlgorithm.ChildParameterSource.fromModelParameter(param.name()))
|
||||||
else:
|
else:
|
||||||
values.append(QgsProcessingModelAlgorithm.ChildParameterSource.fromModelParameter(param.name()))
|
values.append(QgsProcessingModelAlgorithm.ChildParameterSource.fromModelParameter(param.name()))
|
||||||
break
|
break
|
||||||
@ -258,9 +257,13 @@ class ModelerParametersDialog(QDialog):
|
|||||||
for t in outTypes:
|
for t in outTypes:
|
||||||
if isinstance(out, t):
|
if isinstance(out, t):
|
||||||
if dataType is not None and out.datatype in dataType:
|
if dataType is not None and out.datatype in dataType:
|
||||||
values.append(QgsProcessingModelAlgorithm.ChildParameterSource.fromChildOutput(alg.childId(), out.name()))
|
values.append(
|
||||||
|
QgsProcessingModelAlgorithm.ChildParameterSource.fromChildOutput(alg.childId(),
|
||||||
|
out.name()))
|
||||||
else:
|
else:
|
||||||
values.append(QgsProcessingModelAlgorithm.ChildParameterSource.fromChildOutput(alg.childId(), out.name()))
|
values.append(
|
||||||
|
QgsProcessingModelAlgorithm.ChildParameterSource.fromChildOutput(alg.childId(),
|
||||||
|
out.name()))
|
||||||
|
|
||||||
return values
|
return values
|
||||||
|
|
||||||
@ -272,7 +275,8 @@ class ModelerParametersDialog(QDialog):
|
|||||||
return self.model.parameterDefinition(value.parameterName()).description()
|
return self.model.parameterDefinition(value.parameterName()).description()
|
||||||
elif value.source() == QgsProcessingModelAlgorithm.ChildParameterSource.ChildOutput:
|
elif value.source() == QgsProcessingModelAlgorithm.ChildParameterSource.ChildOutput:
|
||||||
alg = self.model.childAlgorithm(value.outputChildId())
|
alg = self.model.childAlgorithm(value.outputChildId())
|
||||||
return self.tr("'{0}' from algorithm '{1}'").format(alg.algorithm().outputDefinition(value.outputName()).description(), alg.description())
|
return self.tr("'{0}' from algorithm '{1}'").format(
|
||||||
|
alg.algorithm().outputDefinition(value.outputName()).description(), alg.description())
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
@ -307,19 +311,23 @@ class ModelerParametersDialog(QDialog):
|
|||||||
if param.isDestination() or param.flags() & QgsProcessingParameterDefinition.FlagHidden:
|
if param.isDestination() or param.flags() & QgsProcessingParameterDefinition.FlagHidden:
|
||||||
continue
|
continue
|
||||||
val = self.wrappers[param.name()].value()
|
val = self.wrappers[param.name()].value()
|
||||||
if ( isinstance(val, QgsProcessingModelAlgorithm.ChildParameterSource) and val.source() == QgsProcessingModelAlgorithm.ChildParameterSource.StaticValue and not param.checkValueIsAcceptable(val.staticValue())) \
|
if (isinstance(val,
|
||||||
or (not isinstance(val, QgsProcessingModelAlgorithm.ChildParameterSource) and not param.checkValueIsAcceptable(val)):
|
QgsProcessingModelAlgorithm.ChildParameterSource) and val.source() == QgsProcessingModelAlgorithm.ChildParameterSource.StaticValue and not param.checkValueIsAcceptable(
|
||||||
|
val.staticValue())) \
|
||||||
|
or (not isinstance(val,
|
||||||
|
QgsProcessingModelAlgorithm.ChildParameterSource) and not param.checkValueIsAcceptable(
|
||||||
|
val)):
|
||||||
self.bar.pushMessage("Error", "Wrong or missing value for parameter '%s'" % param.description(),
|
self.bar.pushMessage("Error", "Wrong or missing value for parameter '%s'" % param.description(),
|
||||||
level=QgsMessageBar.WARNING)
|
level=QgsMessageBar.WARNING)
|
||||||
return None
|
return None
|
||||||
alg.addParameterSource(param.name(), val)
|
alg.addParameterSource(param.name(), val)
|
||||||
|
|
||||||
# outputs = self._alg.outputDefinitions()
|
# outputs = self._alg.outputDefinitions()
|
||||||
#for output in outputs:
|
# for output in outputs:
|
||||||
# if not output.flags() & QgsProcessingParameterDefinition.FlagHidden:
|
# if not output.flags() & QgsProcessingParameterDefinition.FlagHidden:
|
||||||
# name = str(self.valueItems[output.name()].text())
|
# name = str(self.valueItems[output.name()].text())
|
||||||
# if name.strip() != '' and name != ModelerParametersDialog.ENTER_NAME:
|
# if name.strip() != '' and name != ModelerParametersDialog.ENTER_NAME:
|
||||||
# alg.outputs[output.name()] = QgsProcessingModelAlgorithm.ModelOutput(name)
|
# alg.outputs[output.name()] = QgsProcessingModelAlgorithm.ModelOutput(name)
|
||||||
|
|
||||||
selectedOptions = self.dependenciesPanel.selectedoptions
|
selectedOptions = self.dependenciesPanel.selectedoptions
|
||||||
availableDependencies = self.getAvailableDependencies() # spellok
|
availableDependencies = self.getAvailableDependencies() # spellok
|
||||||
|
Loading…
x
Reference in New Issue
Block a user