Skip to content

Commit

Permalink
Add requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed May 10, 2024
1 parent f476418 commit f5317b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 5 additions & 8 deletions npf/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,16 +405,13 @@ def build_file_list(self, v, self_role=None, files=None) -> List[Tuple[str, str,
if not s.noparse:
s.filename = SectionVariable.replace_variables(v, s.filename, role, default_role_map = self.config.get_dict("default_role_map"))
p = SectionVariable.replace_variables(v, s.content, role,default_role_map = self.config.get_dict("default_role_map"))
if s.jinja:
from jinja2 import Environment, PackageLoader, select_autoescape
env = Environment(
loader=PackageLoader("npf"),
autoescape=select_autoescape()
)
template = env.from_string(p)
p = template.render(**v)
else:
p = s.content
if s.jinja:
from jinja2 import Environment, BaseLoader
env = Environment(loader=BaseLoader)
template = env.from_string(p)
p = template.render(**v)
create_list.append((s.filename, p, role))
return create_list

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
'pygtrie',
'packaging',
'importlib_metadata',
'npf-web-extension >= 0.6.4'
'npf-web-extension >= 0.6.4',
'jinja2'
]

setuptools.setup(
Expand Down

0 comments on commit f5317b1

Please sign in to comment.