def templated_file_contents(options, configfile):
paths = options["searchpath"].split(",") # CSV of PATHs
if os.path.isdir(paths[0]):
loader = FileSystemLoader(paths)
else:
loader = URLloader(paths)
env = Environment(loader=loader)
contents, config_full_path, _a_lambda_ = loader.get_source(env, configfile)
template = env.from_string(contents, globals=options)
return template.render(options)
评论列表
文章目录