Use BoolArg when creating arg parser for edges.Settings

This commit is contained in:
Florian Festi 2017-02-20 20:24:47 +01:00
parent 1b3f9dbc3a
commit b440d1c767
1 changed files with 6 additions and 1 deletions

View File

@ -163,9 +163,14 @@ class Settings(object):
if type(default) not in (bool, int, float, str):
raise ValueError("Type not supported: %r", default)
if type(default) is bool:
from boxes import BoolArg
t = BoolArg()
else:
t = type(default)
group.add_argument("--%s_%s" % (prefix, name),
type=type(default),
type=t,
action="store", default=default,
choices=choices,
help=descriptions.get(name))