Skip to content

Commit

Permalink
pynorms
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNew-NOAA committed Jun 13, 2024
1 parent 6b166ba commit 91355ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wxflow/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import jinja2
from markupsafe import Markup

from .template import (replace_tmpl)
from .timetools import (add_to_datetime, strftime, to_fv3time, to_isotime,
to_julian, to_timedelta, to_YMD, to_YMDH)
from .template import (replace_tmpl)

__all__ = ['Jinja']

Expand Down Expand Up @@ -148,7 +148,7 @@ def get_set_env(self, loader: jinja2.BaseLoader, filters: Dict[str, callable] =
else dt if isinstance(dt, SilentUndefined) else delta)
env.filters["to_timedelta"] = lambda delta_str: to_timedelta(delta_str) if not isinstance(delta_str, SilentUndefined) else delta_str
env.filters["replace_tmpl"] = lambda string, tmpl_dict: replace_tmpl(string, tmpl_dict)

# Add any additional filters
if filters is not None:
for filter_name, filter_func in filters.items():
Expand Down
1 change: 1 addition & 0 deletions src/wxflow/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def is_single_type_or_string(s):
else:
return False


def replace_tmpl(string, tmpl_dict):
"""
Replace substrings of input string using input dictionary.
Expand Down

0 comments on commit 91355ba

Please sign in to comment.