run black over stubs, add checking to travis

This commit is contained in:
Maxim Kurnikov
2018-12-03 18:52:44 +03:00
parent d5bc7d4ab2
commit cf6119bf9b
420 changed files with 2295 additions and 8384 deletions

View File

@@ -1,13 +1,10 @@
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
class BaseEngine:
name: Any = ...
dirs: Any = ...
app_dirs: Any = ...
def __init__(
self, params: Dict[str, Union[List[str], bool, str]]
) -> None: ...
def __init__(self, params: Dict[str, Union[List[str], bool, str]]) -> None: ...
@property
def app_dirname(self) -> None: ...
def from_string(self, template_code: Any) -> None: ...

View File

@@ -7,7 +7,6 @@ from django.utils.safestring import SafeText
from .base import BaseEngine
class DjangoTemplates(BaseEngine):
app_dirs: bool
dirs: List[str]
@@ -17,25 +16,17 @@ class DjangoTemplates(BaseEngine):
def __init__(self, params: Dict[str, Any]) -> None: ...
def from_string(self, template_code: str) -> Template: ...
def get_template(self, template_name: str) -> Template: ...
def get_templatetag_libraries(
self, custom_libraries: Dict[str, str]
) -> Dict[str, str]: ...
def get_templatetag_libraries(self, custom_libraries: Dict[str, str]) -> Dict[str, str]: ...
class Template:
template: django.template.base.Template = ...
backend: django.template.backends.django.DjangoTemplates = ...
def __init__(
self, template: Template, backend: DjangoTemplates
) -> None: ...
def __init__(self, template: Template, backend: DjangoTemplates) -> None: ...
@property
def origin(self) -> Origin: ...
def render(
self, context: Any = ..., request: Optional[HttpRequest] = ...
) -> SafeText: ...
def render(self, context: Any = ..., request: Optional[HttpRequest] = ...) -> SafeText: ...
def copy_exception(
exc: TemplateDoesNotExist, backend: Optional[DjangoTemplates] = ...
) -> TemplateDoesNotExist: ...
def copy_exception(exc: TemplateDoesNotExist, backend: Optional[DjangoTemplates] = ...) -> TemplateDoesNotExist: ...
def reraise(exc: TemplateDoesNotExist, backend: DjangoTemplates) -> Any: ...
def get_installed_libraries() -> Dict[str, str]: ...
def get_package_libraries(pkg: Any) -> Iterator[str]: ...

View File

@@ -6,23 +6,16 @@ from django.http.request import HttpRequest
from .base import BaseEngine
from .utils import csrf_input_lazy, csrf_token_lazy
class TemplateStrings(BaseEngine):
app_dirs: bool
dirs: List[Any]
name: str
template_dirs: Tuple[str]
app_dirname: str = ...
def __init__(
self, params: Dict[str, Union[Dict[Any, Any], List[Any], bool, str]]
) -> None: ...
def __init__(self, params: Dict[str, Union[Dict[Any, Any], List[Any], bool, str]]) -> None: ...
def from_string(self, template_code: str) -> Template: ...
def get_template(self, template_name: str) -> Template: ...
class Template(string.Template):
template: str
def render(
self,
context: Optional[Dict[str, str]] = ...,
request: Optional[HttpRequest] = ...,
) -> str: ...
def render(self, context: Optional[Dict[str, str]] = ..., request: Optional[HttpRequest] = ...) -> str: ...

View File

@@ -9,7 +9,6 @@ from django.views.generic.base import TemplateView
from .base import BaseEngine
class Jinja2(BaseEngine):
app_dirs: bool
dirs: List[str]
@@ -19,12 +18,7 @@ class Jinja2(BaseEngine):
app_dirname: str = ...
context_processors: List[str] = ...
env: jinja2.environment.Environment = ...
def __init__(
self,
params: Dict[
str, Union[Dict[str, Union[List[str], bool]], List[str], bool, str]
],
) -> None: ...
def __init__(self, params: Dict[str, Union[Dict[str, Union[List[str], bool]], List[str], bool, str]]) -> None: ...
def from_string(self, template_code: str) -> Template: ...
def get_template(self, template_name: str) -> Template: ...
def template_context_processors(self) -> List[Callable]: ...
@@ -38,28 +32,12 @@ class Template:
self,
context: Optional[
Union[
Dict[
str, Dict[str, Optional[Union[Dict[str, bool], bool, str]]]
],
Dict[str, Dict[str, Optional[Union[Dict[str, bool], bool, str]]]],
Dict[
str,
Dict[
str,
Optional[
Union[
Dict[str, str],
List[
Dict[
str,
Optional[
Union[Dict[str, str], bool, str]
],
]
],
bool,
str,
]
],
Optional[Union[Dict[str, str], List[Dict[str, Optional[Union[Dict[str, str], bool, str]]]], bool, str]],
],
],
Dict[
@@ -68,18 +46,7 @@ class Template:
str,
Union[
Dict[str, int],
List[
Tuple[
Optional[str],
List[
Dict[
str,
Union[Dict[str, bool], bool, str],
]
],
int,
]
],
List[Tuple[Optional[str], List[Dict[str, Union[Dict[str, bool], bool, str]]], int]],
List[str],
bool,
str,
@@ -97,22 +64,7 @@ class Template:
str,
Union[
Dict[str, str],
List[
Tuple[
None,
List[
Dict[
str,
Union[
Dict[str, bool],
bool,
str,
],
]
],
int,
]
],
List[Tuple[None, List[Dict[str, Union[Dict[str, bool], bool, str]]], int]],
List[str],
bool,
str,
@@ -131,23 +83,7 @@ class Template:
str,
Union[
Dict[str, str],
List[
Tuple[
Optional[str],
List[
Dict[
str,
Union[
Dict[str, Union[bool, str]],
time,
int,
str,
],
]
],
int,
]
],
List[Tuple[Optional[str], List[Dict[str, Union[Dict[str, Union[bool, str]], time, int, str]]], int]],
List[str],
bool,
str,
@@ -166,6 +102,4 @@ class Origin:
template_name: Optional[str] = ...
def __init__(self, name: str, template_name: Optional[str]) -> None: ...
def get_exception_info(
exception: TemplateSyntaxError
) -> Dict[str, Union[List[Tuple[int, str]], int, str]]: ...
def get_exception_info(exception: TemplateSyntaxError) -> Dict[str, Union[List[Tuple[int, str]], int, str]]: ...

View File

@@ -3,7 +3,6 @@ from typing import Any, Optional
from django.http.request import HttpRequest
from django.utils.safestring import SafeText
def csrf_input(request: HttpRequest) -> SafeText: ...
csrf_input_lazy: Any