From a1bee817f5133c28ed41357028e37f80b81e5ea1 Mon Sep 17 00:00:00 2001 From: chriskiehl Date: Thu, 9 Jul 2015 19:41:30 -0400 Subject: [PATCH] Added default value to json output. Fixed counter bug --- gooey/python_bindings/argparse_to_json.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gooey/python_bindings/argparse_to_json.py b/gooey/python_bindings/argparse_to_json.py index 5faaaf0..8d0645e 100644 --- a/gooey/python_bindings/argparse_to_json.py +++ b/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 } }