From 13213025a13e4304912ce2afcc5920bd5cf67734 Mon Sep 17 00:00:00 2001 From: Jerome Lebleu Date: Wed, 26 Mar 2014 23:34:19 +0100 Subject: [PATCH] Add built-in types support for 'type' argument in the actions map --- moulinette/actionsmap.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/moulinette/actionsmap.py b/moulinette/actionsmap.py index a60e3aac..6faac3c6 100644 --- a/moulinette/actionsmap.py +++ b/moulinette/actionsmap.py @@ -519,6 +519,9 @@ class ActionsMap(object): for argn, argp in arguments.items(): names = top_parser.format_arg_names(argn, argp.pop('full', None)) + try: argp['type'] = eval(argp['type']) + except: pass + try: extra = argp.pop('extra') arg_dest = (parser.add_argument(*names, **argp)).dest