__init__.py
This file
Path
src/jinja2/__init__.py
57 lines · 2.4 KiB · Python
Last changed by
fix typoDavid Lordbefore adoption9c11dd6
History of this fileTake it
1"""Jinja is a template engine written in pure Python. It provides a2non-XML syntax that supports inline expressions and an optional3sandboxed environment.4"""56from __future__ import annotations78import typing as t910from .bccache import BytecodeCache as BytecodeCache11from .bccache import FileSystemBytecodeCache as FileSystemBytecodeCache12from .bccache import MemcachedBytecodeCache as MemcachedBytecodeCache13from .environment import Environment as Environment14from .environment import Template as Template15from .exceptions import TemplateAssertionError as TemplateAssertionError16from .exceptions import TemplateError as TemplateError17from .exceptions import TemplateNotFound as TemplateNotFound18from .exceptions import TemplateRuntimeError as TemplateRuntimeError19from .exceptions import TemplatesNotFound as TemplatesNotFound20from .exceptions import TemplateSyntaxError as TemplateSyntaxError21from .exceptions import UndefinedError as UndefinedError22from .loaders import BaseLoader as BaseLoader23from .loaders import ChoiceLoader as ChoiceLoader24from .loaders import DictLoader as DictLoader25from .loaders import FileSystemLoader as FileSystemLoader26from .loaders import FunctionLoader as FunctionLoader27from .loaders import ModuleLoader as ModuleLoader28from .loaders import PackageLoader as PackageLoader29from .loaders import PrefixLoader as PrefixLoader30from .runtime import ChainableUndefined as ChainableUndefined31from .runtime import DebugUndefined as DebugUndefined32from .runtime import make_logging_undefined as make_logging_undefined33from .runtime import StrictUndefined as StrictUndefined34from .runtime import Undefined as Undefined35from .utils import clear_caches as clear_caches36from .utils import is_undefined as is_undefined37from .utils import pass_context as pass_context38from .utils import pass_environment as pass_environment39from .utils import pass_eval_context as pass_eval_context40from .utils import select_autoescape as select_autoescape414243def __getattr__(name: str) -> t.Any:44 if name == "__version__":45 import importlib.metadata46 import warnings4748 warnings.warn(49 "The `__version__` attribute is deprecated and will be removed in"50 " Jinja 3.3. Use feature detection or"51 ' `importlib.metadata.version("jinja2")` instead.',52 DeprecationWarning,53 stacklevel=2,54 )55 return importlib.metadata.version("jinja2")5657 raise AttributeError(name)