Load the config from a file and return it as a Config object.
(self)
| 613 | """ |
| 614 | |
| 615 | def load_config(self) -> Config: |
| 616 | """Load the config from a file and return it as a Config object.""" |
| 617 | self.clear() |
| 618 | try: |
| 619 | self._find_file() |
| 620 | except OSError as e: |
| 621 | raise ConfigFileNotFound(str(e)) from e |
| 622 | self._read_file_as_dict() |
| 623 | return self.config |
| 624 | |
| 625 | def load_subconfig(self, fname: str, path: str | None = None) -> None: |
| 626 | """Injected into config file namespace as load_subconfig""" |