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

Method _convert_to_config

traitlets/config/loader.py:580–589  ·  view source on GitHub ↗
(self, dictionary: dict[str, t.Any])

Source from the content-addressed store, hash-verified

578 return t.cast("dict[str, t.Any]", json.load(f))
579
580 def _convert_to_config(self, dictionary: dict[str, t.Any]) -> Config:
581 if "version" in dictionary:
582 version = dictionary.pop("version")
583 else:
584 version = 1
585
586 if version == 1:
587 return Config(dictionary)
588 else:
589 raise ValueError(f"Unknown version of JSON config file: {version}")
590
591 def __enter__(self) -> Config:
592 self.load_config()

Callers 1

load_configMethod · 0.95

Calls 1

ConfigClass · 0.85

Tested by

no test coverage detected