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

Method load_config_file

traitlets/config/application.py:955–974  ·  view source on GitHub ↗

Load config files by filename and path.

(
        self, filename: str, path: str | t.Sequence[str | None] | None = None
    )

Source from the content-addressed store, hash-verified

953
954 @catch_config_error
955 def load_config_file(
956 self, filename: str, path: str | t.Sequence[str | None] | None = None
957 ) -> None:
958 """Load config files by filename and path."""
959 filename, ext = os.path.splitext(filename)
960 new_config = Config()
961 for config, fname in self._load_config_files(
962 filename,
963 path=path,
964 log=self.log,
965 raise_config_file_errors=self.raise_config_file_errors,
966 ):
967 new_config.merge(config)
968 if (
969 fname not in self._loaded_config_files
970 ): # only add to list of loaded files if not previously loaded
971 self._loaded_config_files.append(fname)
972 # add self.cli_config to preserve CLI config priority
973 new_config.merge(self.cli_config)
974 self.update_config(new_config)
975
976 @catch_config_error
977 def load_config_environ(self) -> None:

Callers 10

test_cli_priorityMethod · 0.80
test_multi_fileMethod · 0.80
test_log_collisionsMethod · 0.80
test_log_bad_configMethod · 0.80
initializeMethod · 0.80
initializeMethod · 0.80
initializeMethod · 0.80

Calls 5

_load_config_filesMethod · 0.95
mergeMethod · 0.95
ConfigClass · 0.90
appendMethod · 0.80
update_configMethod · 0.80

Tested by 7

test_cli_priorityMethod · 0.64
test_multi_fileMethod · 0.64
test_log_collisionsMethod · 0.64
test_log_bad_configMethod · 0.64