Skip to content


Configuration Objects

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.


def __getitem__(key)

Returns a config section, creating it if it doesn't exist yet.

ConfigurationSection Objects

class ConfigurationSection(Configuration)


def __getitem__(key)

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.


def __getattr__(key)

Returns the config value from the user section. This is called when the attribute is accessed via dot notation but does not exist.


def __setattr__(key, value)

Sets dictionary value when an attribute is set.

SubparserWrapper Objects

class SubparserWrapper(object)

Wrap subparsers so we can track what options the user passed.


def completer(completer)

Add an arpcomplete completer to this subcommand.


def add_argument(*args, **kwargs)

Add an argument for this subcommand.

This also stores the default for the argument in self.cli.default_arguments.


def get_argument_strings(arg_parser, *args, **kwargs)

Takes argparse arguments and returns a list of argument strings or positional names.


def get_argument_name(arg_parser, *args, **kwargs)

Takes argparse arguments and returns the dest name.


def handle_store_boolean(self, *args, **kwargs)

Does the add_argument for action='store_boolean'.