File: engine.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (57 lines) | stat: -rw-r--r-- 2,221 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from collections.abc import Callable, Sequence
from typing import Any, TypeAlias

from django.template.base import Origin
from django.template.library import Library
from django.template.loaders.base import Loader
from django.utils.functional import cached_property
from django.utils.safestring import SafeString

from .base import Template

_Loader: TypeAlias = Any

class Engine:
    default_builtins: Any
    dirs: list[str]
    app_dirs: bool
    autoescape: bool
    context_processors: list[str] | tuple[str, ...]
    debug: bool
    loaders: Sequence[_Loader]
    string_if_invalid: str
    file_charset: str
    libraries: dict[str, str]
    template_libraries: dict[str, Library]
    builtins: list[str]
    template_builtins: list[Library]
    def __init__(
        self,
        dirs: list[str] | None = None,
        app_dirs: bool = False,
        context_processors: list[str] | tuple[str, ...] | None = None,
        debug: bool = False,
        loaders: Sequence[_Loader] | None = None,
        string_if_invalid: str = "",
        file_charset: str = "utf-8",
        libraries: dict[str, str] | None = None,
        builtins: list[str] | None = None,
        autoescape: bool = True,
    ) -> None: ...
    @staticmethod
    def get_default() -> Engine: ...
    @cached_property
    def template_context_processors(self) -> Sequence[Callable]: ...
    def get_template_builtins(self, builtins: list[str]) -> list[Library]: ...
    def get_template_libraries(self, libraries: dict[str, str]) -> dict[str, Library]: ...
    @cached_property
    def template_loaders(self) -> list[Loader]: ...
    def get_template_loaders(self, template_loaders: Sequence[_Loader]) -> list[Loader]: ...
    def find_template_loader(self, loader: _Loader) -> Loader: ...
    def find_template(
        self, name: str, dirs: None = None, skip: list[Origin] | None = None
    ) -> tuple[Template, Origin]: ...
    def from_string(self, template_code: str) -> Template: ...
    def get_template(self, template_name: str) -> Template: ...
    def render_to_string(self, template_name: str, context: dict[str, Any] | None = None) -> SafeString: ...
    def select_template(self, template_name_list: list[str]) -> Template: ...