import Markup from markupsafe, fix flake8 import warnings
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent c6d864c · Browse files · 9 files·+23 added−20 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+23 added−20 removed
- other:+23 added−20 removed
Provenance
- Commit
9849979- Tree
2ae9934- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
c6d864c
9 files changed+23 added−20 removed
modified:src/jinja2/__init__.py+4 added-3 removed
1 unmodified line2 """Jinja is a template engine written in pure Python. It provides a3 non-XML syntax that supports inline expressions and an optional4 sandboxed environment.5 """6+from markupsafe import escape7+from markupsafe import Markup8+9 from .bccache import BytecodeCache10 from .bccache import FileSystemBytecodeCache11 from .bccache import MemcachedBytecodeCache12 from .environment import Environment23 unmodified lines36 from .runtime import Undefined37 from .utils import clear_caches38 from .utils import contextfunction39 from .utils import environmentfunction37-from .utils import escape40 from .utils import evalcontextfunction41 from .utils import is_undefined40-from .utils import Markup42 from .utils import select_autoescape43 43-__version__ = "2.11.0.dev0"44+__version__ = "2.11.0rc2"modified:src/jinja2/asyncsupport.py+2 added-1 removed
4 unmodified lines5 import asyncio6 import inspect7 from functools import update_wrapper8 9+from markupsafe import Markup10+11 from .environment import TemplateModule12 from .runtime import LoopContext13 from .utils import concat14 from .utils import internalcode13-from .utils import Markup15 from .utils import missing16 17 18 async def concat_async(async_gen):246 unmodified linesmodified:src/jinja2/compiler.py+4 added-3 removed
3 unmodified lines4 from functools import update_wrapper5 from itertools import chain6 from keyword import iskeyword as is_python_keyword7 8+from markupsafe import escape9+from markupsafe import Markup10+11 from . import nodes12 from ._compat import imap13 from ._compat import iteritems14 from ._compat import izip9 unmodified lines24 from .idtracking import VAR_LOAD_UNDEFINED25 from .nodes import EvalContext26 from .optimizer import Optimizer27 from .utils import concat25-from .utils import escape26-from .utils import Markup28 from .visitor import NodeVisitor29 30 operators = {31 "eq": "==",680 unmodified lines712 def visit_Template(self, node, frame=None):713 assert frame is None, "no root frame allowed"714 eval_ctx = EvalContext(self.environment, self.name)715 715- from .runtime import __all__ as exported716+ from .runtime import exported717 718 self.writeline("from __future__ import %s" % ", ".join(code_features))719 self.writeline("from jinja2.runtime import " + ", ".join(exported))720 1123 unmodified linesmodified:src/jinja2/defaults.py-3 removed
40 unmodified lines41 "json.dumps_function": None,42 "json.dumps_kwargs": {"sort_keys": True},43 "ext.i18n.trimmed": False,44 }45-46-# export all constants47-__all__ = tuple(x for x in locals().keys() if x.isupper())modified:src/jinja2/environment.py+3 added-2 removed
6 unmodified lines7 import weakref8 from functools import partial9 from functools import reduce10 11+from markupsafe import Markup12+13 from . import nodes14 from ._compat import encode_filename15 from ._compat import implements_iterator16 from ._compat import implements_to_string38 unmodified lines55 from .utils import have_async_gen56 from .utils import import_string57 from .utils import internalcode58 from .utils import LRUCache57-from .utils import Markup59 from .utils import missing60 61 # for direct template usage we have up to ten living environments62 _spontaneous_environments = LRUCache(10)155 unmodified lines218 219 `autoescape`220 If set to ``True`` the XML/HTML autoescaping feature is enabled by221 default. For more details about autoescaping see221- :class:`~jinja2.utils.Markup`. As of Jinja 2.4 this can also222+ :class:`~markupsafe.Markup`. As of Jinja 2.4 this can also223 be a callable that is passed the template name and has to224 return ``True`` or ``False`` depending on autoescape should be225 enabled by default.226 1136 unmodified linesmodified:src/jinja2/ext.py+2 added-1 removed
2 unmodified lines3 import pprint4 import re5 from sys import version_info6 7+from markupsafe import Markup8+9 from . import nodes10 from ._compat import iteritems11 from ._compat import string_types12 from ._compat import with_metaclass15 unmodified lines28 from .nodes import ContextReference29 from .runtime import concat30 from .utils import contextfunction31 from .utils import import_string30-from .utils import Markup32 33 # the only real useful gettext functions for a Jinja template. Note34 # that ugettext must be assigned to gettext as Jinja doesn't support35 # non unicode strings.669 unmodified linesmodified:src/jinja2/nodes.py+2 added-1 removed
4 unmodified lines5 """6 import operator7 from collections import deque8 9+from markupsafe import Markup10+11 from ._compat import izip12 from ._compat import PY213 from ._compat import text_type14 from ._compat import with_metaclass13-from .utils import Markup15 16 _binop_to_func = {17 "*": operator.mul,18 "/": operator.truediv,1070 unmodified linesmodified:src/jinja2/runtime.py+5 added-5 removed
2 unmodified lines3 import sys4 from itertools import chain5 from types import MethodType6 7-from markupsafe import escape7+from markupsafe import escape # noqa: F4018 from markupsafe import Markup9 from markupsafe import soft_unicode10 11 from ._compat import abc4 unmodified lines16 from ._compat import PY217 from ._compat import string_types18 from ._compat import text_type19 from ._compat import with_metaclass20-from .exceptions import TemplateNotFound21-from .exceptions import TemplateRuntimeError20+from .exceptions import TemplateNotFound # noqa: F40121+from .exceptions import TemplateRuntimeError # noqa: F40122 from .exceptions import UndefinedError23 from .nodes import EvalContext24 from .utils import concat25 from .utils import evalcontextfunction26 from .utils import internalcode27 from .utils import missing28-from .utils import Namespace28+from .utils import Namespace # noqa: F40129 from .utils import object_type_repr30 31 # these variables are exported to the template runtime32-__all__ = [32+exported = [33 "LoopContext",34 "TemplateReference",35 "Macro",36 "Markup",975 unmodified linesmodified:src/jinja2/sandbox.py+1 added-1 removed
7 unmodified lines8 from collections import deque9 from string import Formatter10 11 from markupsafe import EscapeFormatter12+from markupsafe import Markup13 14 from ._compat import abc15 from ._compat import PY216 from ._compat import range_type17 from ._compat import string_types18 from .environment import Environment19 from .exceptions import SecurityError19-from .utils import Markup20 21 #: maximum number of items a range may produce22 MAX_RANGE = 10000023 487 unmodified lines