Browse Source

Correctly use the subparser widgets dictionary

When generating the GUI using subparsers, the subparser widgets dictionary is used instead of the parent one. (Issue #112)
pull/113/head
Enrico Bacis 9 years ago
parent
commit
7d9393d0fc
1 changed files with 2 additions and 1 deletions
  1. 3
      gooey/python_bindings/argparse_to_json.py

3
gooey/python_bindings/argparse_to_json.py

@ -45,7 +45,8 @@ def convert(parser):
if has_required(actions):
raise UnsupportedConfiguration("Gooey doesn't currently support required arguments when subparsers are present.")
layout_type = 'column'
layout_data = {name.lower(): process(sub_parser, widget_dict) for name, sub_parser in get_subparser(actions).choices.iteritems()}
layout_data = {name.lower(): process(sub_parser, getattr(sub_parser, 'widgets', {}))
for name, sub_parser in get_subparser(actions).choices.iteritems()}
else:
layout_type = 'standard'
layout_data = process(parser, widget_dict)

Loading…
Cancel
Save