]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
import Markup from markupsafe, fix flake8 import warnings
authorDavid Lord <davidism@gmail.com>
Mon, 27 Jan 2020 06:23:36 +0000 (22:23 -0800)
committerDavid Lord <davidism@gmail.com>
Mon, 27 Jan 2020 06:23:36 +0000 (22:23 -0800)
src/jinja2/__init__.py
src/jinja2/asyncsupport.py
src/jinja2/compiler.py
src/jinja2/defaults.py
src/jinja2/environment.py
src/jinja2/ext.py
src/jinja2/nodes.py
src/jinja2/runtime.py
src/jinja2/sandbox.py

index 9c4c9cfc5ecd001478c9895f705a91b7a1d2b0d4..8149c702a4df9f73d69a2bc97f0e2883ca7b9155 100644 (file)
@@ -3,6 +3,9 @@
 non-XML syntax that supports inline expressions and an optional
 sandboxed environment.
 """
+from markupsafe import escape
+from markupsafe import Markup
+
 from .bccache import BytecodeCache
 from .bccache import FileSystemBytecodeCache
 from .bccache import MemcachedBytecodeCache
@@ -34,10 +37,8 @@ from .runtime import Undefined
 from .utils import clear_caches
 from .utils import contextfunction
 from .utils import environmentfunction
-from .utils import escape
 from .utils import evalcontextfunction
 from .utils import is_undefined
-from .utils import Markup
 from .utils import select_autoescape
 
-__version__ = "2.11.0.dev0"
+__version__ = "2.11.0rc2"
index d97e46fcd4da2397dc2e6b34925fd4db841267d1..78ba3739d8dee1e644f96e32f833279d941c3f65 100644 (file)
@@ -6,11 +6,12 @@ import asyncio
 import inspect
 from functools import update_wrapper
 
+from markupsafe import Markup
+
 from .environment import TemplateModule
 from .runtime import LoopContext
 from .utils import concat
 from .utils import internalcode
-from .utils import Markup
 from .utils import missing
 
 
index 32dac88cbca1874abfeabbd29cb8857be3955a19..cbc0546d23031a0ed7691c37cd02b072e904841b 100644 (file)
@@ -5,6 +5,9 @@ from functools import update_wrapper
 from itertools import chain
 from keyword import iskeyword as is_python_keyword
 
+from markupsafe import escape
+from markupsafe import Markup
+
 from . import nodes
 from ._compat import imap
 from ._compat import iteritems
@@ -22,8 +25,6 @@ from .idtracking import VAR_LOAD_UNDEFINED
 from .nodes import EvalContext
 from .optimizer import Optimizer
 from .utils import concat
-from .utils import escape
-from .utils import Markup
 from .visitor import NodeVisitor
 
 operators = {
@@ -712,7 +713,7 @@ class CodeGenerator(NodeVisitor):
         assert frame is None, "no root frame allowed"
         eval_ctx = EvalContext(self.environment, self.name)
 
-        from .runtime import __all__ as exported
+        from .runtime import exported
 
         self.writeline("from __future__ import %s" % ", ".join(code_features))
         self.writeline("from jinja2.runtime import " + ", ".join(exported))
index b5d5f4ef63fc3d83b5ce11840dee2b74343d9ca4..8e0e7d771076a8fe0dc71584018338d2caa35fb5 100644 (file)
@@ -42,6 +42,3 @@ 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())
index 08c5e6a08004808adde8c9b291a58873bf1d2f6b..bf44b9deb4a14217d3b1177be8102544ed6ba88c 100644 (file)
@@ -8,6 +8,8 @@ import weakref
 from functools import partial
 from functools import reduce
 
+from markupsafe import Markup
+
 from . import nodes
 from ._compat import encode_filename
 from ._compat import implements_iterator
@@ -54,7 +56,6 @@ from .utils import have_async_gen
 from .utils import import_string
 from .utils import internalcode
 from .utils import LRUCache
-from .utils import Markup
 from .utils import missing
 
 # for direct template usage we have up to ten living environments
@@ -218,7 +219,7 @@ class Environment(object):
         `autoescape`
             If set to ``True`` the XML/HTML autoescaping feature is enabled by
             default.  For more details about autoescaping see
-            :class:`~jinja2.utils.Markup`.  As of Jinja 2.4 this can also
+            :class:`~markupsafe.Markup`.  As of Jinja 2.4 this can also
             be a callable that is passed the template name and has to
             return ``True`` or ``False`` depending on autoescape should be
             enabled by default.
index 01aab74a7de7c1d958c8fe057de10d33e1ea8d0c..9141be4dace15919a68c09ffbd5f96923224f09a 100644 (file)
@@ -4,6 +4,8 @@ import pprint
 import re
 from sys import version_info
 
+from markupsafe import Markup
+
 from . import nodes
 from ._compat import iteritems
 from ._compat import string_types
@@ -27,7 +29,6 @@ from .nodes import ContextReference
 from .runtime import concat
 from .utils import contextfunction
 from .utils import import_string
-from .utils import Markup
 
 # the only real useful gettext functions for a Jinja template.  Note
 # that ugettext must be assigned to gettext as Jinja doesn't support
index f0e9e03239933e076704f532498880877b7ee6b2..9f3edc05f9f3b2e58f341aa3cad94cb91e437152 100644 (file)
@@ -6,11 +6,12 @@ to normalize nodes.
 import operator
 from collections import deque
 
+from markupsafe import Markup
+
 from ._compat import izip
 from ._compat import PY2
 from ._compat import text_type
 from ._compat import with_metaclass
-from .utils import Markup
 
 _binop_to_func = {
     "*": operator.mul,
index d356b074672a085a8946c797729b973727a01fb5..527d4b5e4bf280103b61c3a8edf9f2c9a58cff45 100644 (file)
@@ -4,7 +4,7 @@ import sys
 from itertools import chain
 from types import MethodType
 
-from markupsafe import escape
+from markupsafe import escape  # noqa: F401
 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
-from .exceptions import TemplateRuntimeError
+from .exceptions import TemplateNotFound  # noqa: F401
+from .exceptions import TemplateRuntimeError  # noqa: F401
 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
+from .utils import Namespace  # noqa: F401
 from .utils import object_type_repr
 
 # these variables are exported to the template runtime
-__all__ = [
+exported = [
     "LoopContext",
     "TemplateReference",
     "Macro",
index af4a96e684d8f87358211155c876c034cffeca82..cfd7993aee3358d332495cbcbcc46336a191006f 100644 (file)
@@ -9,6 +9,7 @@ from collections import deque
 from string import Formatter
 
 from markupsafe import EscapeFormatter
+from markupsafe import Markup
 
 from ._compat import abc
 from ._compat import PY2
@@ -16,7 +17,6 @@ from ._compat import range_type
 from ._compat import string_types
 from .environment import Environment
 from .exceptions import SecurityError
-from .utils import Markup
 
 #: maximum number of items a range may produce
 MAX_RANGE = 100000