MCPcopy Create free account
hub / github.com/F-Stack/f-stack / load_config

Function load_config

dpdk/dts/framework/config/__init__.py:302–316  ·  view source on GitHub ↗

Loads the configuration file and the configuration file schema, validates the configuration file, and creates a configuration object.

()

Source from the content-addressed store, hash-verified

300
301
302def load_config() -> Configuration:
303 """
304 Loads the configuration file and the configuration file schema,
305 validates the configuration file, and creates a configuration object.
306 """
307 with open(SETTINGS.config_file_path, "r") as f:
308 config_data = yaml.safe_load(f)
309
310 schema_path = os.path.join(pathlib.Path(__file__).parent.resolve(), "conf_yaml_schema.json")
311
312 with open(schema_path, "r") as f:
313 schema = json.load(f)
314 config: dict[str, Any] = warlock.model_factory(schema, name="_Config")(config_data)
315 config_obj: Configuration = Configuration.from_dict(dict(config))
316 return config_obj
317
318
319CONFIGURATION = load_config()

Callers 1

__init__.pyFile · 0.85

Calls 3

loadMethod · 0.80
dictClass · 0.50
from_dictMethod · 0.45

Tested by

no test coverage detected