Browse Source

Only include non default arguments when invoking process

pull/777/head
Justin Berger 2 years ago
parent
commit
b9960422cf
2 changed files with 7 additions and 3 deletions
  1. 2
      gooey/gui/components/config.py
  2. 8
      gooey/python_bindings/cmd_args.py

2
gooey/gui/components/config.py

@ -46,7 +46,7 @@ class ConfigPage(ScrolledPanel):
def getOptionalArgs(self):
return [widget.getValue()['cmd'] for widget in self.reifiedWidgets
if widget.info['cli_type'] != 'positional']
if widget.info['cli_type'] != 'positional' and str(widget.getValue()['rawValue']) != str(widget.info['data']['default'])]
def isValid(self):

8
gooey/python_bindings/cmd_args.py

@ -52,8 +52,12 @@ def parse_cmd_args(self, args=None):
else:
dest = getattr(action, 'dest', None)
if dest:
cmd_arg = getattr(cmd_args, dest, None)
if cmd_arg:
cmd_arg = getattr(cmd_args, dest, None)
if cmd_arg and dest in item.options and 'initial_value' not in (item.options[dest] or {}):
if item.options[dest] is None:
item.options[dest] = {}
item.options[dest]['initial_value'] = cmd_arg
else:
action.default = cmd_arg
def restore_original_configuration(item):

Loading…
Cancel
Save