fix: black
This commit is contained in:
parent
782a4bf7e2
commit
ae2e30ebb7
1 changed files with 21 additions and 6 deletions
|
|
@ -27,7 +27,12 @@ from gettext import gettext as _
|
|||
|
||||
# try:
|
||||
from tiramisu import Config
|
||||
from tiramisu.error import PropertiesOptionError, LeadershipError, ConfigError, AttributeOptionError
|
||||
from tiramisu.error import (
|
||||
PropertiesOptionError,
|
||||
LeadershipError,
|
||||
ConfigError,
|
||||
AttributeOptionError,
|
||||
)
|
||||
|
||||
|
||||
def get_choice_list(config, properties, display):
|
||||
|
|
@ -336,7 +341,9 @@ class TiramisuCmdlineParser(ArgumentParser):
|
|||
self.fullpath = fullpath
|
||||
self.config = config
|
||||
config_properties = config.property.get()
|
||||
self.config_frozen = "frozen" in config_properties or "everything_frozen" in config_properties
|
||||
self.config_frozen = (
|
||||
"frozen" in config_properties or "everything_frozen" in config_properties
|
||||
)
|
||||
self.root = root
|
||||
self.remove_empty_od = remove_empty_od
|
||||
self.unrestraint = unrestraint
|
||||
|
|
@ -361,7 +368,9 @@ class TiramisuCmdlineParser(ArgumentParser):
|
|||
else:
|
||||
subconfig = subconfig.option(self.root)
|
||||
self.namespace = TiramisuNamespace(self.config, self.root)
|
||||
super().__init__(*args, add_help=add_help, exit_on_error=exit_on_error, **kwargs)
|
||||
super().__init__(
|
||||
*args, add_help=add_help, exit_on_error=exit_on_error, **kwargs
|
||||
)
|
||||
self.register("action", "help", _TiramisuHelpAction)
|
||||
self._config_to_argparser(
|
||||
_forhelp,
|
||||
|
|
@ -692,7 +701,11 @@ class TiramisuCmdlineParser(ArgumentParser):
|
|||
kwargs["type"] = float
|
||||
else:
|
||||
pass
|
||||
if not _forhelp and option.type() != "boolean" and "nargs" not in kwargs.kwargs:
|
||||
if (
|
||||
not _forhelp
|
||||
and option.type() != "boolean"
|
||||
and "nargs" not in kwargs.kwargs
|
||||
):
|
||||
kwargs["nargs"] = "?"
|
||||
actions.setdefault(kwargs.ga_name, []).append(kwargs)
|
||||
|
||||
|
|
@ -705,9 +718,11 @@ class TiramisuCmdlineParser(ArgumentParser):
|
|||
group.add_argument(*args, **kwargs)
|
||||
|
||||
def parse_args(self, *args, valid_mandatory=True, **kwargs):
|
||||
namespaces, unknown = self.parse_known_args(*args, valid_mandatory=valid_mandatory, **kwargs)
|
||||
namespaces, unknown = self.parse_known_args(
|
||||
*args, valid_mandatory=valid_mandatory, **kwargs
|
||||
)
|
||||
if unknown:
|
||||
msg_unknown = 'unrecognized arguments: %s' % ' '.join(unknown)
|
||||
msg_unknown = "unrecognized arguments: %s" % " ".join(unknown)
|
||||
if self.exit_on_error:
|
||||
self.error(msg_unknown)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue