codekingpro/portable-devtools
114k
1import typing as t2 3from .filters import FILTERS as DEFAULT_FILTERS # noqa: F4014from .tests import TESTS as DEFAULT_TESTS # noqa: F4015from .utils import Cycler6from .utils import generate_lorem_ipsum7from .utils import Joiner8from .utils import Namespace9 10if t.TYPE_CHECKING:11 import typing_extensions as te12 13# defaults for the parser / lexer14BLOCK_START_STRING = "{%"15BLOCK_END_STRING = "%}"16VARIABLE_START_STRING = "{{"17VARIABLE_END_STRING = "}}"18COMMENT_START_STRING = "{#"19COMMENT_END_STRING = "#}"20LINE_STATEMENT_PREFIX: t.Optional[str] = None21LINE_COMMENT_PREFIX: t.Optional[str] = None22TRIM_BLOCKS = False23LSTRIP_BLOCKS = False24NEWLINE_SEQUENCE: "te.Literal['\\n', '\\r\\n', '\\r']" = "\n"25KEEP_TRAILING_NEWLINE = False26 27# default filters, tests and namespace28 29DEFAULT_NAMESPACE = {30 "range": range,31 "dict": dict,32 "lipsum": generate_lorem_ipsum,33 "cycler": Cycler,34 "joiner": Joiner,35 "namespace": Namespace,36}37 38# default policies39DEFAULT_POLICIES: t.Dict[str, t.Any] = {40 "compiler.ascii_str": True,41 "urlize.rel": "noopener",42 "urlize.target": None,43 "urlize.extra_schemes": None,44 "truncate.leeway": 5,45 "json.dumps_function": None,46 "json.dumps_kwargs": {"sort_keys": True},47 "ext.i18n.trimmed": False,48}49 