class documentation

class _ArgumentsManager: (source)

Known subclasses: pylint.pyreverse.main.Run

View In Hierarchy

Arguments manager class used to handle command-line arguments and options.

Method __init__ Undocumented
Method add_optik_option DEPRECATED.
Method add_option_group DEPRECATED.
Method cb_set_provider_option DEPRECATED: Optik callback for option setting.
Method config.setter Undocumented
Method generate_config DEPRECATED: Write a configuration file according to the current configuration into the given stream or stdout.
Method global_set_option DEPRECATED: Set option on the correct option provider.
Method help Return the usage string based on the available options.
Method load_command_line_configuration DEPRECATED: Override configuration according to command line parameters.
Method load_config_file DEPRECATED: Dispatch values previously read from a configuration file to each option's provider.
Method load_configuration DEPRECATED: Override configuration according to given parameters.
Method load_configuration_from_config Undocumented
Method load_provider_defaults DEPRECATED: Initialize configuration using default values.
Method optik_option DEPRECATED: Get our personal option definition and return a suitable form for use with optik/optparse.
Method options_providers.setter Undocumented
Method read_config_file DEPRECATED: Read the configuration file but do not load it (i.e. dispatching values to each option's provider).
Method register_options_provider DEPRECATED: Register an options provider.
Method reset_parsers DEPRECATED.
Method set_option Set an option on the namespace object.
Instance Variable cfgfile_parser Undocumented
Instance Variable cmdline_parser Undocumented
Instance Variable config Namespace for all options.
Property options_providers Undocumented
Static Method _add_parser_option Add an argument.
Static Method _parse_toml DEPRECATED: Parse and handle errors of a toml configuration file.
Method _add_arguments_to_parser Add an argument to the correct argument section/group.
Method _generate_config_file Write a configuration file according to the current configuration into stdout.
Method _load_default_argument_values Loads the default values of all registered options.
Method _parse_command_line_configuration Parse the arguments found on the command line into the namespace.
Method _parse_configuration_file Parse the arguments found in a configuration file into the namespace.
Method _register_options_provider Register an options provider and load its defaults.
Instance Variable _all_options Undocumented
Instance Variable _arg_parser The command line argument parser.
Instance Variable _argument_groups_dict Dictionary of all the argument groups.
Instance Variable _base_config Fall back Namespace object created during initialization.
Instance Variable _config Namespace for all options.
Instance Variable _directory_namespaces Mapping of directories and their respective namespace objects.
Instance Variable _maxlevel Undocumented
Instance Variable _mygroups Undocumented
Instance Variable _nocallback_options Undocumented
Instance Variable _optik_option_attrs Undocumented
Instance Variable _option_dicts All option dictionaries that have been registered.
Instance Variable _options_providers Undocumented
Instance Variable _short_options Undocumented
def __init__(self, prog: str, usage: str|None = None, description: str|None = None): (source)

Undocumented

def add_optik_option(self, provider: ConfigProvider, optikcontainer: optparse.OptionParser|optparse.OptionGroup, opt: str, optdict: OptionDict): (source)

DEPRECATED.

def add_option_group(self, group_name: str, _: str|None, options: list[tuple[str, OptionDict]], provider: ConfigProvider): (source)

DEPRECATED.

def cb_set_provider_option(self, option: Any, opt: Any, value: Any, parser: Any): (source)

DEPRECATED: Optik callback for option setting.

Undocumented

def generate_config(self, stream: TextIO|None = None, skipsections: tuple[str, ...] = ()): (source)

DEPRECATED: Write a configuration file according to the current configuration into the given stream or stdout.

def global_set_option(self, opt: str, value: Any): (source)

DEPRECATED: Set option on the correct option provider.

def help(self, level: int|None = None) -> str: (source)

Return the usage string based on the available options.

def load_command_line_configuration(self, args: list[str]|None = None) -> list[str]: (source)

DEPRECATED: Override configuration according to command line parameters. return additional arguments

def load_config_file(self): (source)

DEPRECATED: Dispatch values previously read from a configuration file to each option's provider.

def load_configuration(self, **kwargs: Any): (source)

DEPRECATED: Override configuration according to given parameters.

def load_configuration_from_config(self, config: dict[str, Any]): (source)

Undocumented

def load_provider_defaults(self): (source)

DEPRECATED: Initialize configuration using default values.

def optik_option(self, provider: ConfigProvider, opt: str, optdict: OptionDict) -> tuple[list[str], OptionDict]: (source)

DEPRECATED: Get our personal option definition and return a suitable form for use with optik/optparse.

@options_providers.setter
def options_providers(self, value: list[ConfigProvider]): (source)

Undocumented

def read_config_file(self, config_file: Path|None = None, verbose: bool = False): (source)

DEPRECATED: Read the configuration file but do not load it (i.e. dispatching values to each option's provider). :raises OSError: When the specified config file doesn't exist

def register_options_provider(self, provider: ConfigProvider, own_group: bool = True): (source)

DEPRECATED: Register an options provider.

def reset_parsers(self, usage: str = ''): (source)

DEPRECATED.

def set_option(self, optname: str, value: Any, action: str|None = 'default_value', optdict: (None|str)|OptionDict = 'default_value'): (source)

Set an option on the namespace object.

cfgfile_parser = (source)

Undocumented

cmdline_parser = (source)

Undocumented

Namespace for all options.

Undocumented

@staticmethod
def _add_parser_option(section_group: argparse._ArgumentGroup, argument: _Argument): (source)

Add an argument.

@staticmethod
def _parse_toml(config_file: Path, parser: configparser.ConfigParser): (source)

DEPRECATED: Parse and handle errors of a toml configuration file. TODO: 3.0: Remove deprecated method.

def _add_arguments_to_parser(self, section: str, section_desc: str|None, argument: _Argument): (source)

Add an argument to the correct argument section/group.

def _generate_config_file(self, *, minimal: bool = False) -> str: (source)

Write a configuration file according to the current configuration into stdout.

def _load_default_argument_values(self): (source)

Loads the default values of all registered options.

def _parse_command_line_configuration(self, arguments: Sequence[str]|None = None) -> list[str]: (source)

Parse the arguments found on the command line into the namespace.

def _parse_configuration_file(self, arguments: list[str]): (source)

Parse the arguments found in a configuration file into the namespace.

def _register_options_provider(self, provider: _ArgumentsProvider): (source)

Register an options provider and load its defaults.

Undocumented

_arg_parser = (source)

The command line argument parser.

_argument_groups_dict: dict[str, argparse._ArgumentGroup] = (source)

Dictionary of all the argument groups.

_base_config = (source)

Fall back Namespace object created during initialization. This is necessary for the per-directory configuration support. Whenever we fail to match a file with a directory we fall back to the Namespace object created during initialization.

Namespace for all options.

_directory_namespaces: DirectoryNamespaceDict = (source)

Mapping of directories and their respective namespace objects.

_maxlevel = (source)

Undocumented

_nocallback_options: dict[ConfigProvider, str] = (source)

Undocumented

_optik_option_attrs = (source)

Undocumented

_option_dicts: dict[str, OptionDict] = (source)

All option dictionaries that have been registered.

_options_providers = (source)

Undocumented

_short_options: dict[str, str] = (source)

Undocumented