diff options
| -rw-r--r-- | patternutils/template.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/patternutils/template.py b/patternutils/template.py index 39cc3f3..0e9e1f7 100644 --- a/patternutils/template.py +++ b/patternutils/template.py @@ -8,7 +8,7 @@ import jinja2 from .config import CONFIG_PATH from .types import TemplateCommands, TemplateExtensions -jinja_env = jinja2.Environment() +JINJA_ENV = jinja2.Environment() def to_datetime(value: str, format: str = "%Y-%m-%d") -> datetime: @@ -46,13 +46,13 @@ def splitext(value: str) -> tuple[str, str]: return os.path.splitext(value) -jinja_env.filters["datetime"] = to_datetime -jinja_env.filters["datetimeformat"] = format_datetime -jinja_env.filters["int"] = to_int -jinja_env.filters["float"] = to_float -jinja_env.filters["quote"] = quote -jinja_env.filters["splitpath"] = splitpath -jinja_env.filters["splitext"] = splitext +JINJA_ENV.filters["datetime"] = to_datetime +JINJA_ENV.filters["datetimeformat"] = format_datetime +JINJA_ENV.filters["int"] = to_int +JINJA_ENV.filters["float"] = to_float +JINJA_ENV.filters["quote"] = quote +JINJA_ENV.filters["splitpath"] = splitpath +JINJA_ENV.filters["splitext"] = splitext def get_render_function( @@ -74,7 +74,7 @@ def get_render_function( RuntimeError: If Jinja2 is selected but not installed. """ if engine == "jinja2": - jinja_env_overlay = jinja_env.overlay( + jinja_env_overlay = JINJA_ENV.overlay( loader=jinja2.ChoiceLoader( [ jinja2.FileSystemLoader(os.path.join(CONFIG_PATH, command_name)), |
