X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=argparse_utils.py;h=5a270f6ef22c1845be1bd6c59ab7fde1cb4cfe21;hb=31c81f6539969a5eba864d3305f9fb7bf716a367;hp=8c254ae1f995f6aa684134c595e35968ea5b36cd;hpb=36fea7f15ed17150691b5b3ead75450e575229ef;p=python_utils.git diff --git a/argparse_utils.py b/argparse_utils.py index 8c254ae..5a270f6 100644 --- a/argparse_utils.py +++ b/argparse_utils.py @@ -8,7 +8,6 @@ from typing import Any from overrides import overrides - # This module is commonly used by others in here and should avoid # taking any unnecessary dependencies back on them. @@ -16,9 +15,7 @@ logger = logging.getLogger(__name__) class ActionNoYes(argparse.Action): - def __init__( - self, option_strings, dest, default=None, required=False, help=None - ): + def __init__(self, option_strings, dest, default=None, required=False, help=None): if default is None: msg = 'You must provide a default with Yes/No action' logger.critical(msg) @@ -47,9 +44,7 @@ class ActionNoYes(argparse.Action): @overrides def __call__(self, parser, namespace, values, option_strings=None): - if option_strings.startswith('--no-') or option_strings.startswith( - '--no_' - ): + if option_strings.startswith('--no-') or option_strings.startswith('--no_'): setattr(namespace, self.dest, False) else: setattr(namespace, self.dest, True)