Browse Source

Added default value to json output. Fixed counter bug

pull/94/head
chriskiehl 9 years ago
parent
commit
a1bee817f5
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

@ -84,7 +84,7 @@ def categorize(actions, widget_dict, required=False):
elif is_counter(action):
_json = as_json(action, _get_widget(action) or 'Dropdown', required)
# pre-fill the 'counter' dropdown
_json['choices'] = range(1, 11)
_json['data']['choices'] = map(str, range(1, 11))
yield _json
else:
raise UnknownWidgetType(action)
@ -176,6 +176,7 @@ def as_json(action, widget, required):
'nargs': action.nargs or '',
'commands': action.option_strings,
'choices': action.choices or [],
'default': action.default
}
}

Loading…
Cancel
Save