[core] fix enabled parameter inside group and list

This commit is contained in:
Julien-Haudegond 2020-07-29 11:32:52 +02:00
parent 2d953d7319
commit 524a4ab629
2 changed files with 24 additions and 13 deletions

View file

@ -547,8 +547,8 @@ class BaseNode(BaseObject):
def _buildCmdVars(self):
def _buildAttributeCmdVars(cmdVars, name, attr):
if attr.attributeDesc.group is not None:
if attr.enabled:
if attr.enabled:
if attr.attributeDesc.group is not None:
# if there is a valid command line "group"
v = attr.getValueStr()
cmdVars[name] = '--{name} {value}'.format(name=name, value=v)
@ -557,12 +557,12 @@ class BaseNode(BaseObject):
if v:
cmdVars[attr.attributeDesc.group] = cmdVars.get(attr.attributeDesc.group, '') + \
' ' + cmdVars[name]
elif isinstance(attr, GroupAttribute):
assert isinstance(attr.value, DictModel)
# if the GroupAttribute is not set in a single command line argument,
# the sub-attributes may need to be exposed individually
for v in attr._value:
_buildAttributeCmdVars(cmdVars, v.name, v)
elif isinstance(attr, GroupAttribute):
assert isinstance(attr.value, DictModel)
# if the GroupAttribute is not set in a single command line argument,
# the sub-attributes may need to be exposed individually
for v in attr._value:
_buildAttributeCmdVars(cmdVars, v.name, v)
""" Generate command variables using input attributes and resolved output attributes names and values. """
for uidIndex, value in self._uids.items():