Coverage for procpath/playbook.py: 98%
144 statements
« prev ^ index » next coverage.py v6.5.0, created at 2025-04-05 18:56 +0000
« prev ^ index » next coverage.py v6.5.0, created at 2025-04-05 18:56 +0000
1import argparse
2import configparser
3import fnmatch
4import itertools
5import shlex
6from functools import partial
7from typing import Optional
9from . import cli
12__all__ = 'Playbook', 'PlaybookError'
15def read(
16 command_name: str,
17 section: configparser.SectionProxy,
18 overrides: dict,
19) -> dict:
20 """
21 Read a playbook section.
23 Parent sections are taken into account. Result values are taken
24 reusing the CLI.
25 """
27 parser = cli.build_parser(cls=RaisingArgumentParser) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
28 positional_args, flag_args, multivalue_args = get_special_args(parser, command_name) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
29 special_args = {*positional_args, *flag_args, *multivalue_args} procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
31 cmd = [command_name] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
32 getarg = lambda k: '--{}'.format(k.replace('_', '-')) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
33 section_chain = SectionProxyChain.fromsection(section, overrides=overrides) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
34 for n, v in section_chain.items(): procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
35 if n not in special_args: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
36 cmd.extend((getarg(n), v)) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
38 for n in flag_args: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
39 value = [b for b in section_chain.getboolean(n) if b is not None] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
40 if value and value[0]: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
41 cmd.append(getarg(n)) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_record_plot
43 for n in multivalue_args: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
44 # Lines are retrieved traversing the chain bottom-up, but
45 # should be interpreted in top-down order
46 for line in itertools.chain(*reversed(section_chain.getlines(n, fallback=[]))): procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
47 cmd.extend((getarg(n), line)) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
49 for n in positional_args: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
50 cmd.append(section_chain.get(n, '')) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_arguments
52 result = vars(parser.parse_args(cmd)) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
53 result.pop('logging_level') procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
54 return result procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
57def get_section_value_key(a: argparse.Action) -> str:
58 if a.option_strings: procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
59 return a.option_strings[-1].strip('-').replace('-', '_') procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
60 else:
61 return a.dest procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_arguments
64def get_special_args(parser: argparse.ArgumentParser, section: str) -> tuple:
65 subparser = parser._get_positional_actions()[0].choices[section] procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
67 positional = list(map(get_section_value_key, subparser._get_positional_actions())) procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
68 flag = [ procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
69 get_section_value_key(a)
70 for a in subparser._get_optional_actions()
71 if isinstance(a, (argparse._StoreTrueAction, argparse._StoreFalseAction))
72 ]
73 multivalue = [ procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
74 get_section_value_key(a)
75 for a in subparser._get_optional_actions()
76 if isinstance(a, argparse._AppendAction)
77 ]
78 return positional, flag, multivalue procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
81def split_multiline(s: str) -> list:
82 result = [] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
83 linebuf = [] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
84 for line in s.splitlines(): procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
85 if not line: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
86 continue procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.unit.TestSectionProxyChain.test_mro
88 try: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
89 shlex.split(line) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
90 except ValueError as ex: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_split_multiline
91 if ex.args[0] != 'No escaped character': procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_split_multiline
92 raise procpath.test.cmd.TestPlayCommand.test_split_multiline
93 to_be_continued = True procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_split_multiline
94 else:
95 to_be_continued = False procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
97 if to_be_continued: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
98 linebuf.append(line[:-1]) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_split_multiline
99 elif linebuf: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
100 linebuf.append(line) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_split_multiline
101 result.append(''.join(linebuf)) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_split_multiline
102 linebuf.clear() procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_split_multiline
103 else:
104 result.append(line) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
106 if linebuf: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
107 raise ValueError('Line continuation end expected') procpath.test.cmd.TestPlayCommand.test_split_multiline
109 return result procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.cmd.TestPlayCommand.test_split_multilineprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
112class SectionProxyChain:
113 """
114 ``configparser.SectionProxy`` chain.
116 The purpose of this class is to provide option inheritance. For
117 ``items`` and ``get`` the first found key in the chain wins.
118 Converters, like ``getint``, return all the value across the chain.
119 """
121 _sections: list
123 _unset = object()
125 def __init__(self, *sections):
126 self._sections = list(sections) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
128 def __getattr__(self, name):
129 def getall(*args, **kwargs): procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_mro
130 return [getattr(section, name)(*args, **kwargs) for section in self._sections] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_mro
131 return getall procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_mro
133 def items(self):
134 visited = set(['extends']) # "extends" is a meta-key hence it's skipped procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_items
135 for k in itertools.chain(*self._sections): procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_items
136 if k not in visited: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_items
137 yield k, self.get(k) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_items
138 visited.add(k) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_items
140 def get(self, key, default=_unset):
141 for section in self._sections: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_items
142 if key in section: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_items
143 return section[key] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_items
144 else:
145 return default if default is not self._unset else None procpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.unit.TestSectionProxyChain.test_get
147 @staticmethod
148 def _c3_merge(seqs) -> list:
149 """
150 Do C3 linearisation merge [1]_, on list of object lists.
152 .. [1] https://www.python.org/download/releases/2.3/mro/
153 """
155 result = [] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
156 while True: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
157 nonemptyseqs = [seq for seq in seqs if seq] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
158 if not nonemptyseqs: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
159 return result procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
161 for seq in nonemptyseqs: # find merge candidates among seq heads 161 ↛ 169line 161 didn't jump to line 169, because the loop on line 161 didn't completeprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
162 candidate = seq[0] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
163 nothead = [s for s in nonemptyseqs if candidate in s[1:]] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
164 if nothead: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
165 candidate = None # reject candidate procpath.test.unit.TestSectionProxyChain.test_mro
166 else:
167 break procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
169 if not candidate: 169 ↛ 170line 169 didn't jump to line 170, because the condition on line 169 was never trueprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
170 raise ValueError('Inconsistent hierarchy')
171 result.append(candidate) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
173 for seq in nonemptyseqs: # remove candidate procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
174 if seq[0] == candidate: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
175 seq.pop(0) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
177 @classmethod
178 def _get_mro(cls, section: configparser.SectionProxy) -> list:
179 parent_sections = [section.parser[n] for n in section.getlines('extends', fallback=[])] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
180 return cls._c3_merge( procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
181 [[section]]
182 + list(map(cls._get_mro, parent_sections))
183 + [parent_sections]
184 )
186 @classmethod
187 def fromsection(cls, section: configparser.SectionProxy, *, overrides: Optional[dict] = None):
188 """
189 Create section proxy chain object.
191 The chain has the following precedence:
193 - command-line overrides as a section
194 - given ``section``
195 - parent sections
197 """
199 parent_sections = cls._get_mro(section)[1:] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
201 # Default converters (getint, getboolean, etc) are None
202 converters = { procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
203 n: fn
204 for n, fn in section.parser.converters.items() # type: ignore[attribute-error]
205 if fn is not None
206 }
207 override_parser = configparser.RawConfigParser( procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
208 converters=converters, default_section='overrides', defaults=overrides
209 )
210 override_section = override_parser['overrides'] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
212 return cls(override_section, section, *parent_sections) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestSectionProxyChain.test_converterprocpath.test.unit.TestSectionProxyChain.test_getprocpath.test.unit.TestSectionProxyChain.test_itemsprocpath.test.unit.TestSectionProxyChain.test_mro
215class PlaybookError(Exception):
216 """Generic playbook error."""
219class RaisingArgumentParser(argparse.ArgumentParser):
221 def error(self, message):
222 parts = message.rsplit(':', 1) procpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_arguments
223 if len(parts) == 2: 223 ↛ 226line 223 didn't jump to line 226, because the condition on line 223 was never falseprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_arguments
224 message = '{}: {}'.format(parts[0], parts[1].rsplit('--', 1)[-1]).strip() procpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_arguments
226 raise PlaybookError(f'Invalid section: {message}') procpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_arguments
229class Playbook:
231 _parser = None
232 _overrides = None
234 _command_section_readers = {
235 'query': partial(read, 'query'),
236 'record': partial(read, 'record'),
237 'plot': partial(read, 'plot'),
238 'watch': partial(read, 'watch'),
239 }
241 def __init__(self, fp, overrides: dict):
242 self._overrides = overrides procpath.test.cmd.TestPlayCommand.test_play_absentprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_invalid_fileprocpath.test.cmd.TestPlayCommand.test_play_invalid_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_non_command_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_sectionsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
244 self._parser = configparser.RawConfigParser( # type: ignore[wrong-arg-types] procpath.test.cmd.TestPlayCommand.test_play_absentprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_invalid_fileprocpath.test.cmd.TestPlayCommand.test_play_invalid_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_non_command_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_sectionsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
245 default_section=None,
246 comment_prefixes=('#',),
247 delimiters=(':',),
248 converters={'lines': split_multiline},
249 )
250 try: procpath.test.cmd.TestPlayCommand.test_play_absentprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_invalid_fileprocpath.test.cmd.TestPlayCommand.test_play_invalid_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_non_command_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_sectionsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
251 self._parser.read_file(fp) procpath.test.cmd.TestPlayCommand.test_play_absentprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_invalid_fileprocpath.test.cmd.TestPlayCommand.test_play_invalid_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_non_command_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_sectionsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
252 except configparser.Error as ex: procpath.test.cmd.TestPlayCommand.test_play_invalid_fileprocpath.test.cmd.TestPlayCommand.test_play_invalid_section
253 raise PlaybookError(str(ex)) from ex procpath.test.cmd.TestPlayCommand.test_play_invalid_fileprocpath.test.cmd.TestPlayCommand.test_play_invalid_section
255 def _get_command_name(self, section_name):
256 return section_name.rsplit(':', 1)[-1] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_list_non_command_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_sectionsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
258 def get_command_sections(self, patterns: list):
259 for pattern in patterns: procpath.test.cmd.TestPlayCommand.test_play_absentprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_list_non_command_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_sectionsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
260 for section_name in fnmatch.filter(filter(bool, self._parser), pattern): procpath.test.cmd.TestPlayCommand.test_play_absentprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_list_non_command_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_sectionsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
261 if self._get_command_name(section_name) in self._command_section_readers: procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_list_non_command_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_sectionsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
262 yield section_name procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_list_non_command_sectionprocpath.test.cmd.TestPlayCommand.test_play_list_sectionsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
264 def get_command(self, section_name) -> dict:
265 command_name = self._get_command_name(section_name) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
266 section = self._parser[section_name] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
267 reader_fn = self._command_section_readers[command_name] procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override
269 return reader_fn(section, self._overrides) procpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_override