Skip to content

Commit

Permalink
[core] command line: do not export an empty list on the command line
Browse files Browse the repository at this point in the history
but export empty string params on the command line (avoid to switch to
another default value from the command line if not provided).
  • Loading branch information
fabiencastan committed Jan 31, 2024
1 parent 6ed3bbf commit 2663fb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ def _buildAttributeCmdVars(cmdVars, name, attr):
cmdVars[name] = '--{name} "{value}"'.format(name=name, value=v)
cmdVars[name + 'Value'] = str(v)

if v:
# do not export on the command line, if it is an empty list
if not isinstance(attr, ListAttribute) or v:
cmdVars[group] = cmdVars.get(group, '') + ' ' + cmdVars[name]
elif isinstance(attr, GroupAttribute):
assert isinstance(attr.value, DictModel)
Expand Down Expand Up @@ -764,7 +765,8 @@ def _buildAttributeCmdVars(cmdVars, name, attr):
self._cmdVars[name] = '--{name} "{value}"'.format(name=name, value=v)
self._cmdVars[name + 'Value'] = str(v)

if v:
# do not export on the command line, if it is an empty list
if not isinstance(attr, ListAttribute) or v:
self._cmdVars[attr.attributeDesc.group] = self._cmdVars.get(attr.attributeDesc.group, '') + \
' ' + self._cmdVars[name]

Expand Down

0 comments on commit 2663fb8

Please sign in to comment.