2 from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Type, Union
\r
4 from .bccache import BytecodeCache
\r
5 from .loaders import BaseLoader
\r
6 from .runtime import Context, Undefined
\r
8 if sys.version_info >= (3, 6):
\r
9 from typing import Awaitable, AsyncIterator
\r
11 def get_spontaneous_environment(*args): ...
\r
12 def create_cache(size): ...
\r
13 def copy_cache(cache): ...
\r
14 def load_extensions(environment, extensions): ...
\r
17 sandboxed = ... # type: bool
\r
18 overlayed = ... # type: bool
\r
19 linked_to = ... # type: Any
\r
20 shared = ... # type: bool
\r
21 exception_handler = ... # type: Any
\r
22 exception_formatter = ... # type: Any
\r
23 code_generator_class = ... # type: Any
\r
24 context_class = ... # type: Any
\r
25 block_start_string = ... # type: Text
\r
26 block_end_string = ... # type: Text
\r
27 variable_start_string = ... # type: Text
\r
28 variable_end_string = ... # type: Text
\r
29 comment_start_string = ... # type: Text
\r
30 comment_end_string = ... # type: Text
\r
31 line_statement_prefix = ... # type: Text
\r
32 line_comment_prefix = ... # type: Text
\r
33 trim_blocks = ... # type: bool
\r
34 lstrip_blocks = ... # type: Any
\r
35 newline_sequence = ... # type: Text
\r
36 keep_trailing_newline = ... # type: bool
\r
37 undefined = ... # type: Type[Undefined]
\r
38 optimized = ... # type: bool
\r
39 finalize = ... # type: Callable
\r
40 autoescape = ... # type: Any
\r
41 filters = ... # type: Any
\r
42 tests = ... # type: Any
\r
43 globals = ... # type: Dict[str, Any]
\r
44 loader = ... # type: BaseLoader
\r
45 cache = ... # type: Any
\r
46 bytecode_cache = ... # type: BytecodeCache
\r
47 auto_reload = ... # type: bool
\r
48 extensions = ... # type: List
\r
49 def __init__(self, block_start_string: Text = ..., block_end_string: Text = ..., variable_start_string: Text = ..., variable_end_string: Text = ..., comment_start_string: Any = ..., comment_end_string: Text = ..., line_statement_prefix: Text = ..., line_comment_prefix: Text = ..., trim_blocks: bool = ..., lstrip_blocks: bool = ..., newline_sequence: Text = ..., keep_trailing_newline: bool = ..., extensions: List = ..., optimized: bool = ..., undefined: Type[Undefined] = ..., finalize: Optional[Callable] = ..., autoescape: Union[bool, Callable[[str], bool]] = ..., loader: Optional[BaseLoader] = ..., cache_size: int = ..., auto_reload: bool = ..., bytecode_cache: Optional[BytecodeCache] = ..., enable_async: bool = ...) -> None: ...
\r
50 def add_extension(self, extension): ...
\r
51 def extend(self, **attributes): ...
\r
52 def overlay(self, block_start_string: Text = ..., block_end_string: Text = ..., variable_start_string: Text = ..., variable_end_string: Text = ..., comment_start_string: Any = ..., comment_end_string: Text = ..., line_statement_prefix: Text = ..., line_comment_prefix: Text = ..., trim_blocks: bool = ..., lstrip_blocks: bool = ..., extensions: List = ..., optimized: bool = ..., undefined: Type[Undefined] = ..., finalize: Callable = ..., autoescape: bool = ..., loader: Optional[BaseLoader] = ..., cache_size: int = ..., auto_reload: bool = ..., bytecode_cache: Optional[BytecodeCache] = ...): ...
\r
53 lexer = ... # type: Any
\r
54 def iter_extensions(self): ...
\r
55 def getitem(self, obj, argument): ...
\r
56 def getattr(self, obj, attribute): ...
\r
57 def call_filter(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ..., context: Optional[Any] = ..., eval_ctx: Optional[Any] = ...): ...
\r
58 def call_test(self, name, value, args: Optional[Any] = ..., kwargs: Optional[Any] = ...): ...
\r
59 def parse(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ...
\r
60 def lex(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ...): ...
\r
61 def preprocess(self, source: Text, name: Optional[Any] = ..., filename: Optional[Any] = ...): ...
\r
62 def compile(self, source, name: Optional[Any] = ..., filename: Optional[Any] = ..., raw: bool = ..., defer_init: bool = ...): ...
\r
63 def compile_expression(self, source: Text, undefined_to_none: bool = ...): ...
\r
64 def compile_templates(self, target, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ..., zip: str = ..., log_function: Optional[Any] = ..., ignore_errors: bool = ..., py_compile: bool = ...): ...
\r
65 def list_templates(self, extensions: Optional[Any] = ..., filter_func: Optional[Any] = ...): ...
\r
66 def handle_exception(self, exc_info: Optional[Any] = ..., rendered: bool = ..., source_hint: Optional[Any] = ...): ...
\r
67 def join_path(self, template: Union[Template, Text], parent: Text) -> Text: ...
\r
68 def get_template(self, name: Union[Template, Text], parent: Optional[Text] = ..., globals: Optional[Any] = ...) -> Template: ...
\r
69 def select_template(self, names: List[Union[Template, Text]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ...
\r
70 def get_or_select_template(self, template_name_or_list: Union[Union[Template, Text], List[Union[Template, Text]]], parent: Optional[Text] = ..., globals: Optional[Dict[str, Any]] = ...) -> Template: ...
\r
71 def from_string(self, source: Text, globals: Optional[Dict[str, Any]] = ..., template_class: Optional[Type[Template]] = ...) -> Template: ...
\r
72 def make_globals(self, d: Optional[Dict[str, Any]]) -> Dict[str, Any]: ...
\r
74 # Frequently added extensions are included here:
\r
75 # from InternationalizationExtension:
\r
76 def install_gettext_translations(self, translations: Any, newstyle: Optional[bool]): ...
\r
77 def install_null_translations(self, newstyle: Optional[bool]): ...
\r
78 def install_gettext_callables(self, gettext: Callable, ngettext: Callable,
\r
79 newstyle: Optional[bool]): ...
\r
80 def uninstall_gettext_translations(self, translations: Any): ...
\r
81 def extract_translations(self, source: Any, gettext_functions: Any): ...
\r
82 newstyle_gettext = ... # type: bool
\r
85 def __new__(cls, source, block_start_string: Any = ..., block_end_string: Any = ..., variable_start_string: Any = ..., variable_end_string: Any = ..., comment_start_string: Any = ..., comment_end_string: Any = ..., line_statement_prefix: Any = ..., line_comment_prefix: Any = ..., trim_blocks: Any = ..., lstrip_blocks: Any = ..., newline_sequence: Any = ..., keep_trailing_newline: Any = ..., extensions: Any = ..., optimized: bool = ..., undefined: Any = ..., finalize: Optional[Any] = ..., autoescape: bool = ...): ...
\r
86 environment: Environment = ...
\r
88 def from_code(cls, environment, code, globals, uptodate: Optional[Any] = ...): ...
\r
90 def from_module_dict(cls, environment, module_dict, globals): ...
\r
91 def render(self, *args, **kwargs) -> Text: ...
\r
92 def stream(self, *args, **kwargs) -> TemplateStream: ...
\r
93 def generate(self, *args, **kwargs) -> Iterator[Text]: ...
\r
94 def new_context(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ...
\r
95 def make_module(self, vars: Optional[Dict[str, Any]] = ..., shared: bool = ..., locals: Optional[Dict[str, Any]] = ...) -> Context: ...
\r
97 def module(self) -> Any: ...
\r
98 def get_corresponding_lineno(self, lineno): ...
\r
100 def is_up_to_date(self) -> bool: ...
\r
102 def debug_info(self): ...
\r
104 if sys.version_info >= (3, 6):
\r
105 def render_async(self, *args, **kwargs) -> Awaitable[Text]: ...
\r
106 def generate_async(self, *args, **kwargs) -> AsyncIterator[Text]: ...
\r
109 class TemplateModule:
\r
110 __name__ = ... # type: Any
\r
111 def __init__(self, template, context) -> None: ...
\r
112 def __html__(self): ...
\r
114 class TemplateExpression:
\r
115 def __init__(self, template, undefined_to_none) -> None: ...
\r
116 def __call__(self, *args, **kwargs): ...
\r
118 class TemplateStream:
\r
119 def __init__(self, gen) -> None: ...
\r
120 def dump(self, fp, encoding: Optional[Text] = ..., errors: Text = ...): ...
\r
121 buffered = ... # type: bool
\r
122 def disable_buffering(self) -> None: ...
\r
123 def enable_buffering(self, size: int = ...) -> None: ...
\r
124 def __iter__(self): ...
\r
125 def __next__(self): ...
\r