"vscode:/vscode.git/clone" did not exist on "3f8b1d250674035c557b315ca8deead241f493f6"
Commit 711eddcf authored by lintangsutawika's avatar lintangsutawika
Browse files

moved constructor process to inside load_yaml_config

parent 12fc1233
......@@ -489,11 +489,20 @@ def import_function(loader, node):
return function
# Add the import_function constructor to the YAML loader
yaml.add_constructor("!function", import_function)
def ignore_constructor(loader, node):
return node
def simple_load_yaml_config(yaml_path=None, yaml_config=None, yaml_dir=None):
yaml.add_constructor("!function", ignore_constructor)
with open(yaml_path, "rb") as file:
yaml_config = yaml.full_load(file)
return yaml_config
def load_yaml_config(yaml_path=None, yaml_config=None, yaml_dir=None):
# Add the import_function constructor to the YAML loader
yaml.add_constructor("!function", import_function)
if yaml_config is None:
with open(yaml_path, "rb") as file:
yaml_config = yaml.full_load(file)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment