def _get_env(self, template):
tmppath = os.path.join(_DEFAULT_RES_PATH,
self._get_template_filename(template))
if resource_exists(__package__, tmppath):
return Environment(
loader=FileSystemLoader(resource_filename(__package__, _DEFAULT_RES_PATH)),
trim_blocks=True
)
else:
raise FileNotFoundError('No such template')
评论列表
文章目录