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

Function load_pyconfig_files

traitlets/config/loader.py:1158–1179  ·  view source on GitHub ↗

Load multiple Python config files, merging each of them in turn. Parameters ---------- config_files : list of str List of config files names to load and merge into the config. path : unicode The full path to the location of the config files.

(config_files: list[str], path: str)

Source from the content-addressed store, hash-verified

1156
1157
1158def load_pyconfig_files(config_files: list[str], path: str) -> Config:
1159 """Load multiple Python config files, merging each of them in turn.
1160
1161 Parameters
1162 ----------
1163 config_files : list of str
1164 List of config files names to load and merge into the config.
1165 path : unicode
1166 The full path to the location of the config files.
1167 """
1168 config = Config()
1169 for cf in config_files:
1170 loader = PyFileConfigLoader(cf, path=path)
1171 try:
1172 next_config = loader.load_config()
1173 except ConfigFileNotFound:
1174 pass
1175 except Exception:
1176 raise
1177 else:
1178 config.merge(next_config)
1179 return config

Callers

nothing calls this directly

Calls 4

load_configMethod · 0.95
mergeMethod · 0.95
ConfigClass · 0.85
PyFileConfigLoaderClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…