MCPcopy Index your code
hub / github.com/bpython/bpython / fill_config_with_default_values

Function fill_config_with_default_values

bpython/config.py:87–96  ·  view source on GitHub ↗
(
    config: ConfigParser, default_values: Mapping[str, Mapping[str, Any]]
)

Source from the content-addressed store, hash-verified

85
86
87def fill_config_with_default_values(
88 config: ConfigParser, default_values: Mapping[str, Mapping[str, Any]]
89) -> None:
90 for section in default_values.keys():
91 if not config.has_section(section):
92 config.add_section(section)
93
94 for opt, val in default_values[section].items():
95 if not config.has_option(section, opt):
96 config.set(section, opt, str(val))
97
98
99class Config:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected