(loader, node)
| 350 | |
| 351 | |
| 352 | def import_function(loader, node): |
| 353 | function_name = loader.construct_scalar(node) |
| 354 | yaml_path = os.path.dirname(loader.name) |
| 355 | |
| 356 | *module_name, function_name = function_name.split(".") |
| 357 | if isinstance(module_name, list): |
| 358 | module_name = ".".join(module_name) |
| 359 | module_path = os.path.normpath(os.path.join(yaml_path, "{}.py".format(module_name))) |
| 360 | |
| 361 | spec = importlib.util.spec_from_file_location(module_name, module_path) |
| 362 | module = importlib.util.module_from_spec(spec) |
| 363 | spec.loader.exec_module(module) |
| 364 | |
| 365 | function = getattr(module, function_name) |
| 366 | return function |
| 367 | |
| 368 | |
| 369 | def load_yaml_config(yaml_path=None, yaml_config=None, yaml_dir=None, mode="full"): |
nothing calls this directly
no outgoing calls
no test coverage detected