mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-23 03:22:32 +08:00
Support for PathLike objects in Jinja2 2.11.0 (#3683)
This commit is contained in:
10
third_party/2and3/jinja2/loaders.pyi
vendored
10
third_party/2and3/jinja2/loaders.pyi
vendored
@@ -1,8 +1,16 @@
|
||||
import sys
|
||||
|
||||
from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union
|
||||
from types import ModuleType
|
||||
|
||||
from .environment import Environment
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from os import PathLike
|
||||
_SearchPath = Union[Text, PathLike[str], Iterable[Union[Text, PathLike[str]]]]
|
||||
else:
|
||||
_SearchPath = Union[Text, Iterable[Text]]
|
||||
|
||||
def split_template_path(template: Text) -> List[Text]: ...
|
||||
|
||||
class BaseLoader:
|
||||
@@ -15,7 +23,7 @@ class FileSystemLoader(BaseLoader):
|
||||
searchpath: Text
|
||||
encoding: Any
|
||||
followlinks: Any
|
||||
def __init__(self, searchpath: Union[Text, Iterable[Text]], encoding: Text = ..., followlinks: bool = ...) -> None: ...
|
||||
def __init__(self, searchpath: _SearchPath, encoding: Text = ..., followlinks: bool = ...) -> None: ...
|
||||
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ...
|
||||
def list_templates(self): ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user