configuration¶
Configuration Objects¶
python
class Configuration(AttrDict)
Represents the running configuration.
This class never raises IndexError, instead it will return None if a section or option does not yet exist.
__getitem__¶
python
def __getitem__(key: Hashable) -> Any
Returns a config section, creating it if it doesn't exist yet.
ConfigurationSection Objects¶
python
class ConfigurationSection(Configuration)
__getitem__¶
python
def __getitem__(key: Hashable) -> Any
Returns a config value, pulling from the user section as a fallback.
This is called when the attribute is accessed either via the get method or through [ ] index.
__getattr__¶
python
def __getattr__(key: str) -> Any
Returns the config value from the user section.
This is called when the attribute is accessed via dot notation but does not exist.
__setattr__¶
python
def __setattr__(key: str, value: Any) -> None
Sets dictionary value when an attribute is set.
SubparserWrapper Objects¶
python
class SubparserWrapper(object)
Wrap subparsers so we can track what options the user passed.
get_child_subparsers¶
python
def get_child_subparsers() -> Any
Lazily create and return the _SubParsersAction for nested sub-subcommands.
completer¶
python
def completer(completer: Any) -> None
Add an arpcomplete completer to this subcommand.
add_argument¶
python
def add_argument(*args: Any, **kwargs: Any) -> None
Add an argument for this subcommand.
This also stores the default for the argument in self.cli.default_arguments.
get_argument_strings¶
python
def get_argument_strings(arg_parser: Any, *args: Any,
**kwargs: Any) -> List[str]
Takes argparse arguments and returns a list of argument strings or positional names.
get_argument_name¶
python
def get_argument_name(arg_parser: Any, *args: Any, **kwargs: Any) -> Any
Takes argparse arguments and returns the dest name.
handle_store_boolean¶
python
def handle_store_boolean(self: 'MILC | SubparserWrapper', *args: Any,
**kwargs: Any) -> Any
Does the add_argument for action='store_boolean'.