geowatch.utils.configargparse_ext module¶
- class geowatch.utils.configargparse_ext.RawDescriptionDefaultsHelpFormatter(prog, indent_increment=2, max_help_position=24, width=None)[source]¶
Bases:
RawDescriptionHelpFormatter
,ArgumentDefaultsHelpFormatter
- class geowatch.utils.configargparse_ext.ArgumentParser(*args, **kwargs)[source]¶
Bases:
ArgumentParser
Todo: maybe submit these as new features to configargparse
Adds additional ability to handle special string settings
- New keys:
formatter_class : can be “raw” config_file_parser_class : can be “yaml”
- parse_known_args(args=None, namespace=None, config_file_contents=None, env_vars=NoParam, ignore_help_args=False, ignore_write_args=False)[source]¶
Supports all the same args as the ArgumentParser.parse_args(..), as well as the following additional args.
- Parameters:
args – a list of args as in argparse, or a string (eg. “-x -y bla”)
config_file_contents (str)
env_vars (dict)
ignore_help_args (bool) – This flag determines behavior when user specifies –help or -h. If False, it will have the default behavior - printing help and exiting. If True, it won’t do either.