diff options
author | David Lord <davidism@gmail.com> | 2020-01-26 21:12:47 -0800 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2020-01-26 21:12:47 -0800 |
commit | 4ec93a454b9b0a95f3772d56ebdac25702268f68 (patch) | |
tree | 6e49647d2c9ae2d1df6e2991da8afab75548df16 /src | |
parent | 8d85f9cb6b7617e62cc07dcd7f022b10027b5dab (diff) | |
download | jinja-4ec93a454b9b0a95f3772d56ebdac25702268f68.tar.gz |
Revert "add warning and alias for jinja2"
This reverts commit fc9c60ba457efc4cadf6fa2886567e0ee6ca1a99.
Diffstat (limited to 'src')
-rw-r--r-- | src/jinja/__init__.py | 2 | ||||
-rw-r--r-- | src/jinja/compiler.py | 2 | ||||
-rw-r--r-- | src/jinja/defaults.py | 3 | ||||
-rw-r--r-- | src/jinja/runtime.py | 10 |
4 files changed, 10 insertions, 7 deletions
diff --git a/src/jinja/__init__.py b/src/jinja/__init__.py index d758a5b0..9c4c9cfc 100644 --- a/src/jinja/__init__.py +++ b/src/jinja/__init__.py @@ -40,4 +40,4 @@ from .utils import is_undefined from .utils import Markup from .utils import select_autoescape -__version__ = "2.11.0rc1" +__version__ = "2.11.0.dev0" diff --git a/src/jinja/compiler.py b/src/jinja/compiler.py index f52d788f..88b4988b 100644 --- a/src/jinja/compiler.py +++ b/src/jinja/compiler.py @@ -712,7 +712,7 @@ class CodeGenerator(NodeVisitor): assert frame is None, "no root frame allowed" eval_ctx = EvalContext(self.environment, self.name) - from .runtime import exported + from .runtime import __all__ as exported self.writeline("from __future__ import %s" % ", ".join(code_features)) self.writeline("from jinja.runtime import " + ", ".join(exported)) diff --git a/src/jinja/defaults.py b/src/jinja/defaults.py index 8e0e7d77..b5d5f4ef 100644 --- a/src/jinja/defaults.py +++ b/src/jinja/defaults.py @@ -42,3 +42,6 @@ DEFAULT_POLICIES = { "json.dumps_kwargs": {"sort_keys": True}, "ext.i18n.trimmed": False, } + +# export all constants +__all__ = tuple(x for x in locals().keys() if x.isupper()) diff --git a/src/jinja/runtime.py b/src/jinja/runtime.py index d178e41e..f6d58a61 100644 --- a/src/jinja/runtime.py +++ b/src/jinja/runtime.py @@ -4,7 +4,7 @@ import sys from itertools import chain from types import MethodType -from markupsafe import escape # noqa: F401 +from markupsafe import escape from markupsafe import Markup from markupsafe import soft_unicode @@ -17,19 +17,19 @@ from ._compat import PY2 from ._compat import string_types from ._compat import text_type from ._compat import with_metaclass -from .exceptions import TemplateNotFound # noqa: F401 -from .exceptions import TemplateRuntimeError # noqa: F401 +from .exceptions import TemplateNotFound +from .exceptions import TemplateRuntimeError from .exceptions import UndefinedError from .nodes import EvalContext from .utils import concat from .utils import evalcontextfunction from .utils import internalcode from .utils import missing -from .utils import Namespace # noqa: F401 +from .utils import Namespace from .utils import object_type_repr # these variables are exported to the template runtime -exported = [ +__all__ = [ "LoopContext", "TemplateReference", "Macro", |