Skip to content

Commit 451a3fa

Browse files
committed
Reformat code
1 parent cdbb57d commit 451a3fa

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

python/plugins/processing/modeler/ModelerParametersDialog.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,10 @@ def getAvailableValuesOfType(self, paramType, outTypes=[], dataTypes=[]):
244244
elif not isinstance(outTypes, (tuple, list)):
245245
outTypes = [outTypes]
246246

247-
return self.model.availableSourcesForChild(self.childId, [p.typeName() for p in paramType if issubclass(p, QgsProcessingParameterDefinition)],
248-
[o.typeName() for o in outTypes if issubclass(o, QgsProcessingOutputDefinition)], dataTypes)
247+
return self.model.availableSourcesForChild(self.childId, [p.typeName() for p in paramType if
248+
issubclass(p, QgsProcessingParameterDefinition)],
249+
[o.typeName() for o in outTypes if
250+
issubclass(o, QgsProcessingOutputDefinition)], dataTypes)
249251

250252
def resolveValueDescription(self, value):
251253
if isinstance(value, QgsProcessingModelChildParameterSource):
@@ -277,7 +279,8 @@ def setPreviousValues(self):
277279
if value is None:
278280
value = param.defaultValue()
279281

280-
if isinstance(value, QgsProcessingModelChildParameterSource) and value.source() == QgsProcessingModelChildParameterSource.StaticValue:
282+
if isinstance(value,
283+
QgsProcessingModelChildParameterSource) and value.source() == QgsProcessingModelChildParameterSource.StaticValue:
281284
value = value.staticValue()
282285

283286
self.wrappers[param.name()].setValue(value)
@@ -306,21 +309,24 @@ def createAlgorithm(self):
306309
try:
307310
val = self.wrappers[param.name()].value()
308311
except InvalidParameterValue:
309-
self.bar.pushMessage(self.tr("Error"), self.tr("Wrong or missing value for parameter '{}'").format(param.description()),
312+
self.bar.pushMessage(self.tr("Error"),
313+
self.tr("Wrong or missing value for parameter '{}'").format(param.description()),
310314
level=QgsMessageBar.WARNING)
311315
return None
312316

313317
if isinstance(val, QgsProcessingModelChildParameterSource):
314318
val = [val]
315-
elif not (isinstance(val, list) and all([isinstance(subval, QgsProcessingModelChildParameterSource) for subval in val])):
319+
elif not (isinstance(val, list) and all(
320+
[isinstance(subval, QgsProcessingModelChildParameterSource) for subval in val])):
316321
val = [QgsProcessingModelChildParameterSource.fromStaticValue(val)]
317322
for subval in val:
318323
if (isinstance(subval, QgsProcessingModelChildParameterSource) and
319324
subval.source() == QgsProcessingModelChildParameterSource.StaticValue and
320-
not param.checkValueIsAcceptable(subval.staticValue())) \
325+
not param.checkValueIsAcceptable(subval.staticValue())) \
321326
or (subval is None and not param.flags() & QgsProcessingParameterDefinition.FlagOptional):
322-
self.bar.pushMessage(self.tr("Error"), self.tr("Wrong or missing value for parameter '{}'").format(param.description()),
323-
level=QgsMessageBar.WARNING)
327+
self.bar.pushMessage(self.tr("Error"), self.tr("Wrong or missing value for parameter '{}'").format(
328+
param.description()),
329+
level=QgsMessageBar.WARNING)
324330
return None
325331
alg.addParameterSources(param.name(), val)
326332

0 commit comments

Comments
 (0)