src.cli module

class src.cli.CustomHelpFormatter(*args, **kwargs)[source]

Bases: argparse.RawDescriptionHelpFormatter, argparse.ArgumentDefaultsHelpFormatter

Modify help text formatter to only display variable placeholder (“metavar”) once, to save space. Taken from https://stackoverflow.com/a/16969505 . Also inherit from RawDescriptionHelpFormatter in order to preserve line breaks in description only (https://stackoverflow.com/a/18462760).

__init__(*args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

_format_action_invocation(action)[source]
class src.cli.RecordDefaultsAction(option_strings, dest, nargs=None, const=None, default=None, required=False, **kwargs)[source]

Bases: argparse.Action

Add boolean to record if user actually set argument’s value, or if we’re using the specified default. From https://stackoverflow.com/a/50936474. This also re-implements the ‘store_true’ and ‘store_false’ actions, in order to give defaults information on boolean flags.

flag_suffix = '_is_default_'
__init__(option_strings, dest, nargs=None, const=None, default=None, required=False, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

class src.cli.CLIHandler(code_root, cli_config, partial_defaults=None)[source]

Bases: object

__init__(code_root, cli_config, partial_defaults=None)[source]

Initialize self. See help(type(self)) for accurate signature.

iter_cli_actions()[source]
iteritems_cli(group_nm=None)[source]
static _append_to_entry(d, key, str_)[source]
make_parser(d)[source]
add_parser_group(d, target_obj)[source]
static canonical_arg_name(str_)[source]
add_parser_argument(d, target_obj, target_name)[source]
edit_defaults(**kwargs)[source]
preparse_cli(args=None)[source]
parse_cli(args=None)[source]
class src.cli.FrameworkCLIHandler(code_root, cli_rel_path)[source]

Bases: src.cli.CLIHandler

__init__(code_root, cli_rel_path)[source]

Initialize self. See help(type(self)) for accurate signature.

make_parser(d)[source]
parse_positionals(var_name)[source]
parse_cli(args=None)[source]
class src.cli.PodDataTuple(sorted_lists, pod_data, realm_data)

Bases: tuple

_asdict()

Return a new OrderedDict which maps field names to their values.

_field_defaults = {}
_fields = ('sorted_lists', 'pod_data', 'realm_data')
_fields_defaults = {}
classmethod _make(iterable)

Make a new PodDataTuple object from a sequence or iterable

_replace(**kwds)

Return a new PodDataTuple object replacing specified fields with new values

property pod_data

Alias for field number 1

property realm_data

Alias for field number 2

property sorted_lists

Alias for field number 0

src.cli.load_pod_settings(code_root, pod=None, pod_list=None)[source]

Wrapper to load POD settings files, used by ConfigManager and CLIInfoHandler.

class src.cli.InfoCLIHandler(code_root, arg_list)[source]

Bases: object

__init__(code_root, arg_list)[source]

Initialize self. See help(type(self)) for accurate signature.

info_cmds()[source]
_print_pod_info(pod, verbose)[source]
info_pods_all(*args)[source]
info_pod(pod)[source]
info_realms_all(*args)[source]
info_realm(realm)[source]