Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only include non default arguments when invoking process #777

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gooey/gui/components/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def getPositionalArgs(self):

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):
Expand Down
8 changes: 6 additions & 2 deletions gooey/python_bindings/cmd_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ def overwrite_default_values(item, cmd_args):
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):
Expand Down