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

Text inputs with nargs don't work properly with list initial values #756

Open
8 tasks done
JozsefKutas opened this issue Oct 24, 2021 · 0 comments · May be fixed by #757
Open
8 tasks done

Text inputs with nargs don't work properly with list initial values #756

JozsefKutas opened this issue Oct 24, 2021 · 0 comments · May be fixed by #757

Comments

@JozsefKutas
Copy link

JozsefKutas commented Oct 24, 2021

  • OS : Windows 10
  • Python Version : 3.9.6
  • Gooey Version : 1.0.8.1
  • Thorough description of problem
    • Expected Behavior
    • Actual Behavior

List initial values for text inputs with nargs don't get caught by the argparse_to_json.textinput_with_nargs_and_list_default condition, and so aren't properly transformed. I would expect initial_values to be handled in the same way as default values.

  • A minimal code example -- preferably copy/pastable in the issue itself (less time figuring out how to run your code == more time debugging!)
import gooey
from gooey import Gooey


@Gooey
def main():
    parser = gooey.GooeyParser(description='Sum some integers.')
    parser.add_argument('--integers', type=int, nargs='+', default=[2, 2])
    parser.add_argument('--integers2', type=int, nargs='+', gooey_options={'initial_value': [2, 2]})
    args = parser.parse_args()
    print(sum(args.integers) + sum(args.integers2))


main()
  • Screenshot (if visual quirk)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant