mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-11 06:21:58 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from enum import Enum
|
||||
from typing import (Any, Callable, Dict, Iterator, List, Optional, Tuple, Type,
|
||||
Union)
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.template.backends.dummy import TemplateStrings
|
||||
from django.template.context import Context
|
||||
@@ -36,24 +35,14 @@ class TokenType(Enum):
|
||||
class VariableDoesNotExist(Exception):
|
||||
msg: str = ...
|
||||
params: Tuple[Union[Dict[str, str], str]] = ...
|
||||
def __init__(
|
||||
self, msg: str, params: Tuple[Union[Dict[str, str], str]] = ...
|
||||
) -> None: ...
|
||||
def __init__(self, msg: str, params: Tuple[Union[Dict[str, str], str]] = ...) -> None: ...
|
||||
|
||||
class Origin:
|
||||
name: str = ...
|
||||
template_name: Optional[Union[bytes, str]] = ...
|
||||
loader: Optional[
|
||||
Union[
|
||||
django.template.backends.dummy.TemplateStrings,
|
||||
django.template.loaders.base.Loader,
|
||||
]
|
||||
] = ...
|
||||
loader: Optional[Union[django.template.backends.dummy.TemplateStrings, django.template.loaders.base.Loader]] = ...
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
template_name: Optional[Union[bytes, str]] = ...,
|
||||
loader: Optional[Union[TemplateStrings, Loader]] = ...,
|
||||
self, name: str, template_name: Optional[Union[bytes, str]] = ..., loader: Optional[Union[TemplateStrings, Loader]] = ...
|
||||
) -> None: ...
|
||||
def __eq__(self, other: Origin) -> bool: ...
|
||||
@property
|
||||
@@ -66,11 +55,7 @@ class Template:
|
||||
source: str = ...
|
||||
nodelist: django.template.base.NodeList = ...
|
||||
def __init__(
|
||||
self,
|
||||
template_string: str,
|
||||
origin: Optional[Origin] = ...,
|
||||
name: Optional[str] = ...,
|
||||
engine: Optional[Engine] = ...,
|
||||
self, template_string: str, origin: Optional[Origin] = ..., name: Optional[str] = ..., engine: Optional[Engine] = ...
|
||||
) -> None: ...
|
||||
def __iter__(self) -> None: ...
|
||||
def render(self, context: Context) -> Any: ...
|
||||
@@ -87,11 +72,7 @@ class Token:
|
||||
lineno: Optional[int] = ...
|
||||
position: Optional[Tuple[int, int]] = ...
|
||||
def __init__(
|
||||
self,
|
||||
token_type: TokenType,
|
||||
contents: str,
|
||||
position: Optional[Tuple[int, int]] = ...,
|
||||
lineno: Optional[int] = ...,
|
||||
self, token_type: TokenType, contents: str, position: Optional[Tuple[int, int]] = ..., lineno: Optional[int] = ...
|
||||
) -> None: ...
|
||||
def split_contents(self) -> List[str]: ...
|
||||
|
||||
@@ -100,13 +81,7 @@ class Lexer:
|
||||
verbatim: Union[bool, str] = ...
|
||||
def __init__(self, template_string: str) -> None: ...
|
||||
def tokenize(self) -> List[Token]: ...
|
||||
def create_token(
|
||||
self,
|
||||
token_string: str,
|
||||
position: Optional[Tuple[int, int]],
|
||||
lineno: int,
|
||||
in_tag: bool,
|
||||
) -> Token: ...
|
||||
def create_token(self, token_string: str, position: Optional[Tuple[int, int]], lineno: int, in_tag: bool) -> Token: ...
|
||||
|
||||
class DebugLexer(Lexer):
|
||||
template_string: str
|
||||
@@ -129,16 +104,9 @@ class Parser:
|
||||
) -> None: ...
|
||||
def parse(self, parse_until: Optional[Tuple[str]] = ...) -> NodeList: ...
|
||||
def skip_past(self, endtag: str) -> None: ...
|
||||
def extend_nodelist(
|
||||
self, nodelist: NodeList, node: Node, token: Token
|
||||
) -> None: ...
|
||||
def extend_nodelist(self, nodelist: NodeList, node: Node, token: Token) -> None: ...
|
||||
def error(self, token: Token, e: Union[Exception, str]) -> Exception: ...
|
||||
def invalid_block_tag(
|
||||
self,
|
||||
token: Token,
|
||||
command: str,
|
||||
parse_until: Union[List[Any], Tuple[str]] = ...,
|
||||
) -> Any: ...
|
||||
def invalid_block_tag(self, token: Token, command: str, parse_until: Union[List[Any], Tuple[str]] = ...) -> Any: ...
|
||||
def unclosed_block_tag(self, parse_until: Tuple[str]) -> Any: ...
|
||||
def next_token(self) -> Token: ...
|
||||
def prepend_token(self, token: Token) -> None: ...
|
||||
@@ -154,33 +122,12 @@ filter_re: Any
|
||||
class FilterExpression:
|
||||
token: str = ...
|
||||
filters: List[
|
||||
Tuple[
|
||||
Callable,
|
||||
List[
|
||||
Tuple[
|
||||
bool,
|
||||
Union[
|
||||
django.template.base.Variable,
|
||||
django.utils.safestring.SafeText,
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
] = ...
|
||||
var: Union[
|
||||
django.template.base.Variable, django.utils.safestring.SafeText
|
||||
Tuple[Callable, List[Tuple[bool, Union[django.template.base.Variable, django.utils.safestring.SafeText]]]]
|
||||
] = ...
|
||||
var: Union[django.template.base.Variable, django.utils.safestring.SafeText] = ...
|
||||
def __init__(self, token: str, parser: Parser) -> None: ...
|
||||
def resolve(
|
||||
self,
|
||||
context: Union[Dict[str, Dict[str, str]], Context],
|
||||
ignore_failures: bool = ...,
|
||||
) -> Any: ...
|
||||
def args_check(
|
||||
name: str,
|
||||
func: Callable,
|
||||
provided: List[Tuple[bool, Union[Variable, SafeText]]],
|
||||
) -> bool: ...
|
||||
def resolve(self, context: Union[Dict[str, Dict[str, str]], Context], ignore_failures: bool = ...) -> Any: ...
|
||||
def args_check(name: str, func: Callable, provided: List[Tuple[bool, Union[Variable, SafeText]]]) -> bool: ...
|
||||
args_check: Any = ...
|
||||
|
||||
class Variable:
|
||||
@@ -190,12 +137,7 @@ class Variable:
|
||||
translate: bool = ...
|
||||
message_context: Optional[str] = ...
|
||||
def __init__(self, var: Union[Dict[Any, Any], str]) -> None: ...
|
||||
def resolve(
|
||||
self,
|
||||
context: Union[
|
||||
Dict[str, Dict[str, Union[int, str]]], Context, int, str
|
||||
],
|
||||
) -> Any: ...
|
||||
def resolve(self, context: Union[Dict[str, Dict[str, Union[int, str]]], Context, int, str]) -> Any: ...
|
||||
|
||||
class Node:
|
||||
must_be_first: bool = ...
|
||||
@@ -229,6 +171,4 @@ class VariableNode(Node):
|
||||
|
||||
kwarg_re: Any
|
||||
|
||||
def token_kwargs(
|
||||
bits: List[str], parser: Parser, support_legacy: bool = ...
|
||||
) -> Dict[str, FilterExpression]: ...
|
||||
def token_kwargs(bits: List[str], parser: Parser, support_legacy: bool = ...) -> Dict[str, FilterExpression]: ...
|
||||
|
||||
Reference in New Issue
Block a user