1# -*- coding: utf-8 -*- 2from ._compat import range_type 3from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401 4from .tests import TESTS as DEFAULT_TESTS # noqa: F401 5from .utils import Cycler 6from .utils import generate_lorem_ipsum 7from .utils import Joiner 8from .utils import Namespace 9 10# defaults for the parser / lexer 11BLOCK_START_STRING = "{%" 12BLOCK_END_STRING = "%}" 13VARIABLE_START_STRING = "{{" 14VARIABLE_END_STRING = "}}" 15COMMENT_START_STRING = "{#" 16COMMENT_END_STRING = "#}" 17LINE_STATEMENT_PREFIX = None 18LINE_COMMENT_PREFIX = None 19TRIM_BLOCKS = False 20LSTRIP_BLOCKS = False 21NEWLINE_SEQUENCE = "\n" 22KEEP_TRAILING_NEWLINE = False 23 24# default filters, tests and namespace 25 26DEFAULT_NAMESPACE = { 27 "range": range_type, 28 "dict": dict, 29 "lipsum": generate_lorem_ipsum, 30 "cycler": Cycler, 31 "joiner": Joiner, 32 "namespace": Namespace, 33} 34 35# default policies 36DEFAULT_POLICIES = { 37 "compiler.ascii_str": True, 38 "urlize.rel": "noopener", 39 "urlize.target": None, 40 "truncate.leeway": 5, 41 "json.dumps_function": None, 42 "json.dumps_kwargs": {"sort_keys": True}, 43 "ext.i18n.trimmed": False, 44} 45