[fix] Correct ActionsMapParser and empty value in the api

This commit is contained in:
Jérôme Lebleu 2014-05-16 22:57:37 +02:00
parent 054dfeab7a
commit 1e84edbd7f

View file

@ -64,6 +64,8 @@ class _HTTPArgumentParser(object):
elif isinstance(value, str): elif isinstance(value, str):
if option_string is not None: if option_string is not None:
arg_strings.append(option_string) arg_strings.append(option_string)
# TODO: Review this fix
if value:
arg_strings.append(value) arg_strings.append(value)
else: else:
arg_strings.append(value) arg_strings.append(value)
@ -79,6 +81,7 @@ class _HTTPArgumentParser(object):
for dest, opt in self._optional.items(): for dest, opt in self._optional.items():
if dest in args: if dest in args:
arg_strings = append(arg_strings, args[dest], opt[0]) arg_strings = append(arg_strings, args[dest], opt[0])
return self._parser.parse_args(arg_strings, namespace) return self._parser.parse_args(arg_strings, namespace)
def _error(self, message): def _error(self, message):
@ -333,7 +336,7 @@ class ActionsMapParser(BaseActionsMapParser):
## Implement virtual properties ## Implement virtual properties
name = 'api' interface = 'api'
## Implement virtual methods ## Implement virtual methods