Skip to content
Myr

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

9 files+23 added−20 removed

modified:src/jinja2/__init__.py+4 added-3 removed
1 unmodified line
2"""Jinja is a template engine written in pure Python. It provides a3non-XML syntax that supports inline expressions and an optional4sandboxed environment.5"""6from markupsafe import escape7from markupsafe import Markup89from .bccache import BytecodeCache10from .bccache import FileSystemBytecodeCache11from .bccache import MemcachedBytecodeCache12from .environment import Environment
23 unmodified lines
36from .runtime import Undefined37from .utils import clear_caches38from .utils import contextfunction39from .utils import environmentfunction37from .utils import escape40from .utils import evalcontextfunction41from .utils import is_undefined40from .utils import Markup42from .utils import select_autoescape4343__version__ = "2.11.0.dev0"44__version__ = "2.11.0rc2"
modified:src/jinja2/asyncsupport.py+2 added-1 removed
4 unmodified lines
5import asyncio6import inspect7from functools import update_wrapper89from markupsafe import Markup1011from .environment import TemplateModule12from .runtime import LoopContext13from .utils import concat14from .utils import internalcode13from .utils import Markup15from .utils import missing161718async def concat_async(async_gen):
246 unmodified lines
modified:src/jinja2/compiler.py+4 added-3 removed
3 unmodified lines
4from functools import update_wrapper5from itertools import chain6from keyword import iskeyword as is_python_keyword78from markupsafe import escape9from markupsafe import Markup1011from . import nodes12from ._compat import imap13from ._compat import iteritems14from ._compat import izip
9 unmodified lines
24from .idtracking import VAR_LOAD_UNDEFINED25from .nodes import EvalContext26from .optimizer import Optimizer27from .utils import concat25from .utils import escape26from .utils import Markup28from .visitor import NodeVisitor2930operators = {31 "eq": "==",
680 unmodified lines
712 def visit_Template(self, node, frame=None):713 assert frame is None, "no root frame allowed"714 eval_ctx = EvalContext(self.environment, self.name)715715 from .runtime import __all__ as exported716 from .runtime import exported717718 self.writeline("from __future__ import %s" % ", ".join(code_features))719 self.writeline("from jinja2.runtime import " + ", ".join(exported))720
1123 unmodified lines
modified:src/jinja2/defaults.py-3 removed
40 unmodified lines
41 "json.dumps_function": None,42 "json.dumps_kwargs": {"sort_keys": True},43 "ext.i18n.trimmed": False,44}4546# 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 lines
7import weakref8from functools import partial9from functools import reduce1011from markupsafe import Markup1213from . import nodes14from ._compat import encode_filename15from ._compat import implements_iterator16from ._compat import implements_to_string
38 unmodified lines
55from .utils import have_async_gen56from .utils import import_string57from .utils import internalcode58from .utils import LRUCache57from .utils import Markup59from .utils import missing6061# for direct template usage we have up to ten living environments62_spontaneous_environments = LRUCache(10)
155 unmodified lines
218219 `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 lines
modified:src/jinja2/ext.py+2 added-1 removed
2 unmodified lines
3import pprint4import re5from sys import version_info67from markupsafe import Markup89from . import nodes10from ._compat import iteritems11from ._compat import string_types12from ._compat import with_metaclass
15 unmodified lines
28from .nodes import ContextReference29from .runtime import concat30from .utils import contextfunction31from .utils import import_string30from .utils import Markup3233# 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 lines
modified:src/jinja2/nodes.py+2 added-1 removed
4 unmodified lines
5"""6import operator7from collections import deque89from markupsafe import Markup1011from ._compat import izip12from ._compat import PY213from ._compat import text_type14from ._compat import with_metaclass13from .utils import Markup1516_binop_to_func = {17 "*": operator.mul,18 "/": operator.truediv,
1070 unmodified lines
modified:src/jinja2/runtime.py+5 added-5 removed
2 unmodified lines
3import sys4from itertools import chain5from types import MethodType67from markupsafe import escape7from markupsafe import escape # noqa: F4018from markupsafe import Markup9from markupsafe import soft_unicode1011from ._compat import abc
4 unmodified lines
16from ._compat import PY217from ._compat import string_types18from ._compat import text_type19from ._compat import with_metaclass20from .exceptions import TemplateNotFound21from .exceptions import TemplateRuntimeError20from .exceptions import TemplateNotFound # noqa: F40121from .exceptions import TemplateRuntimeError # noqa: F40122from .exceptions import UndefinedError23from .nodes import EvalContext24from .utils import concat25from .utils import evalcontextfunction26from .utils import internalcode27from .utils import missing28from .utils import Namespace28from .utils import Namespace # noqa: F40129from .utils import object_type_repr3031# these variables are exported to the template runtime32__all__ = [32exported = [33 "LoopContext",34 "TemplateReference",35 "Macro",36 "Markup",
975 unmodified lines
modified:src/jinja2/sandbox.py+1 added-1 removed
7 unmodified lines
8from collections import deque9from string import Formatter1011from markupsafe import EscapeFormatter12from markupsafe import Markup1314from ._compat import abc15from ._compat import PY216from ._compat import range_type17from ._compat import string_types18from .environment import Environment19from .exceptions import SecurityError19from .utils import Markup2021#: maximum number of items a range may produce22MAX_RANGE = 10000023
487 unmodified lines