Commit 2091a0f1 authored by lintangsutawika's avatar lintangsutawika
Browse files

no need for yaml loader function

parent a179c472
...@@ -256,30 +256,9 @@ def get_git_commit_hash(): ...@@ -256,30 +256,9 @@ def get_git_commit_hash():
return git_hash return git_hash
def get_yaml_config(yaml_path):
with open(yaml_path, "r") as f:
return yaml.load(f, yaml.Loader)
def RegistryDecorator():
registry = {}
def registrar(func):
if func.TASK_NAME is None:
name = func.__name__
else:
name = func.TASK_NAME
registry[name] = func
return func
registrar.all = registry
return registrar
register_task = RegistryDecorator()
env = Environment(loader=BaseLoader, undefined=StrictUndefined) env = Environment(loader=BaseLoader, undefined=StrictUndefined)
def apply_template(template, doc): def apply_template(template, doc):
rtemplate = env.from_string(template) rtemplate = env.from_string(template)
return rtemplate.render(**doc) return rtemplate.render(**doc)
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