class documentation
class Parser: (source)
Parser with additional functions for config file processing.
Method | __init__ |
Initialize a parser. |
Method | clean |
Clean None values out of the arg namespace. |
Method | config |
Undocumented |
Method | convert |
Converts strings in an args namespace to values. |
Method | create |
Creates the initial set of args. |
Method | error |
Undocumented |
Method | parse |
Parses argv. |
Method | postprocess |
Postprocesses the subset of pytype_single_args that appear in args. |
Instance Variable | pytype |
Undocumented |
Instance Variable | _parser |
Undocumented |
Instance Variable | _pytype |
Undocumented |
Initialize a parser. Args: parser: An argparse.ArgumentParser or compatible object pytype_single_args: Iterable of args that will be passed to pytype_single
Clean None values out of the arg namespace. This lets us check for a config file arg based on whether the None default was overwritten. Args: args: an argparse.Namespace. keys: Keys to clean if None
Parses argv. Commandline-only args are parsed normally. File-configurable args appear in the parsed args only if explicitly present in argv. Args: argv: sys.argv[1:] Returns: An argparse.Namespace.