argparser: Style fixes.

This commit is contained in:
Florian Bruhin 2015-08-20 07:08:59 +02:00
parent 774ef58432
commit 506917882e

View File

@ -81,7 +81,7 @@ class ArgumentParser(argparse.ArgumentParser):
raise ArgumentParserExit(status, msg) raise ArgumentParserExit(status, msg)
def error(self, msg): def error(self, msg):
raise ArgumentParserError(msg[0].upper() + msg[1:]) raise ArgumentParserError(msg.capitalize())
def enum_getter(enum): def enum_getter(enum):
@ -101,11 +101,11 @@ def enum_getter(enum):
return _get_enum_item return _get_enum_item
def multitype_conv(tpl): def multitype_conv(types):
"""Function factory to get a type converter for a choice of types.""" """Function factory to get a type converter for a choice of types."""
def _convert(value): def _convert(value):
"""Convert a value according to an iterable of possible arg types.""" """Convert a value according to an iterable of possible arg types."""
for typ in set(tpl): for typ in set(types):
if isinstance(typ, str): if isinstance(typ, str):
if value == typ: if value == typ:
return value return value