Skip to content

Commit

Permalink
add loopcontrol
Browse files Browse the repository at this point in the history
  • Loading branch information
grizz committed Jan 20, 2024
1 parent eff28b9 commit 36f7f0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/netom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def set_search_path(self, search_path):
else:
self.engine = tmpl.get_engine(self._engine_type)(search_path=search_path)
self.engine.engine.filters.update(self.filters)
self.engine.engine.add_extension('jinja2.ext.loopcontrols')

def _render(self, filename, data, fobj):
# engine.engine.undefined = IgnoreUndefined
Expand All @@ -110,7 +111,7 @@ def render_string(self, filename, data):
self._render(filename, data, fobj)
return fobj.getvalue()

def render_from_string(self, instr, data):
def render_from_string(self, instr: str, data: dict):
return self.engine._render_str_to_str(instr, data)

def bgp_neighbors(self, data, fobj, validate=True):
Expand Down

0 comments on commit 36f7f0f

Please sign in to comment.