Skip to content

Commit

Permalink
add jinja2.ext.do
Browse files Browse the repository at this point in the history
  • Loading branch information
sjurtf committed Mar 27, 2023
1 parent aeaaef3 commit 5d34056
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ def updateData():
for i in config["get"]:
load(urlparse(i))

env = Environment(loader=FileSystemLoader(
[]), trim_blocks=True, lstrip_blocks=True)
env = Environment(extensions=['jinja2.ext.do'], loader=FileSystemLoader([]), trim_blocks=True, lstrip_blocks=True)

env.filters["netmask"] = lambda ip: netaddr.IPNetwork(ip).netmask
env.filters["cidr"] = lambda ip: netaddr.IPNetwork(ip).prefixlen
Expand Down

0 comments on commit 5d34056

Please sign in to comment.