Skip to content

Commit 7f218c7

Browse files
committed
[processing] fixes in modeler to make multiple inputs work correctly
1 parent 1e4d6a9 commit 7f218c7

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

python/plugins/processing/modeler/ModelerAlgorithm.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,7 @@ def serialize(self):
464464
pt = self.algPos[i]
465465
s += str(pt.x()) + ',' + str(pt.y()) + '\n'
466466
if len(self.dependencies[i]) != 0:
467-
s += ','.join([str(index) for index in self.dependencies[i]]) \
468-
+ '\n'
467+
s += ','.join([str(index) for index in self.dependencies[i]]) + '\n'
469468
else:
470469
s += str(None) + '\n'
471470
for param in alg.parameters:
@@ -517,12 +516,12 @@ def prepareAlgorithm(self, alg, iAlg):
517516
else:
518517
value = self.getValueFromAlgorithmAndParameter(aap)
519518

520-
# We allow unexistent filepaths, since that allows
521-
# algorithms to skip some conversion routines
522-
if not param.setValue(value) and not isinstance(param,
523-
ParameterDataObject):
524-
raise GeoAlgorithmExecutionException('Wrong value: '
525-
+ str(value))
519+
# We allow unexistent filepaths, since that allows
520+
# algorithms to skip some conversion routines
521+
if not param.setValue(value) and not isinstance(param,
522+
ParameterDataObject):
523+
raise GeoAlgorithmExecutionException('Wrong value: '
524+
+ str(value))
526525
for out in alg.outputs:
527526
if not out.hidden:
528527
val = self.algOutputs[iAlg][out.name]
@@ -579,9 +578,8 @@ def getValueFromAlgorithmAndParameter(self, aap):
579578
return None
580579
if float(aap.alg) \
581580
== float(AlgorithmAndParameter.PARENT_MODEL_ALGORITHM):
582-
for key in self.paramValues.keys():
583-
if aap.param == key:
584-
return self.paramValues[key]
581+
if aap.param in self.paramValues.keys():
582+
return self.paramValues[aap.param]
585583
for param in self.parameters:
586584
if aap.param == param.name:
587585
return param.value

0 commit comments

Comments
 (0)