MCPcopy Create free account
hub / github.com/Dizzy-K/AutoPT / _load_yaml_file

Function _load_yaml_file

config/loader.py:30–40  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

28
29
30def _load_yaml_file(path: Path) -> dict[str, Any]:
31 try:
32 import yaml
33 except ImportError as exc:
34 raise ConfigError("PyYAML is required to load YAML config files.") from exc
35
36 with path.open("r", encoding="utf-8") as stream:
37 data = yaml.safe_load(stream) or {}
38 if not isinstance(data, dict):
39 raise ConfigError(f"Config file must contain a mapping: {path}")
40 return data
41
42
43def _coerce_bool(value: Any, default: bool = False) -> bool:

Callers 1

_load_merged_yamlFunction · 0.85

Calls 1

ConfigErrorClass · 0.85

Tested by

no test coverage detected