MCPcopy Create free account
hub / github.com/ipython/traitlets / load_config

Method load_config

traitlets/config/loader.py:565–574  ·  view source on GitHub ↗

Load the config from a file and return it as a Config object.

(self)

Source from the content-addressed store, hash-verified

563 """
564
565 def load_config(self) -> Config:
566 """Load the config from a file and return it as a Config object."""
567 self.clear()
568 try:
569 self._find_file()
570 except OSError as e:
571 raise ConfigFileNotFound(str(e)) from e
572 dct = self._read_file_as_dict()
573 self.config = self._convert_to_config(dct)
574 return self.config
575
576 def _read_file_as_dict(self) -> dict[str, t.Any]:
577 with open(self.full_filename) as f:

Callers 4

test_jsonMethod · 0.95
test_v2raiseMethod · 0.95
__enter__Method · 0.95

Calls 5

_read_file_as_dictMethod · 0.95
_convert_to_configMethod · 0.95
ConfigFileNotFoundClass · 0.85
clearMethod · 0.80
_find_fileMethod · 0.80

Tested by 3

test_jsonMethod · 0.76
test_v2raiseMethod · 0.76