mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-19 10:21:14 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -7,7 +7,6 @@ from django.core.checks.messages import CheckMessage, Warning
|
||||
from django.urls.converters import UUIDConverter
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
|
||||
|
||||
class ResolverMatch:
|
||||
func: Callable = ...
|
||||
args: Tuple = ...
|
||||
@@ -29,19 +28,13 @@ class ResolverMatch:
|
||||
) -> None: ...
|
||||
def __getitem__(self, index: int) -> Any: ...
|
||||
|
||||
def get_resolver(
|
||||
urlconf: Optional[Union[Type[Any], str]] = ...
|
||||
) -> URLResolver: ...
|
||||
def get_ns_resolver(
|
||||
ns_pattern: str, resolver: URLResolver, converters: Tuple
|
||||
) -> URLResolver: ...
|
||||
def get_resolver(urlconf: Optional[Union[Type[Any], str]] = ...) -> URLResolver: ...
|
||||
def get_ns_resolver(ns_pattern: str, resolver: URLResolver, converters: Tuple) -> URLResolver: ...
|
||||
|
||||
class LocaleRegexDescriptor:
|
||||
attr: str = ...
|
||||
def __init__(self, attr: Any) -> None: ...
|
||||
def __get__(
|
||||
self, instance: Optional[RegexPattern], cls: Type[RegexPattern] = ...
|
||||
) -> LocaleRegexDescriptor: ...
|
||||
def __get__(self, instance: Optional[RegexPattern], cls: Type[RegexPattern] = ...) -> LocaleRegexDescriptor: ...
|
||||
|
||||
class CheckURLMixin:
|
||||
def describe(self) -> str: ...
|
||||
@@ -50,24 +43,16 @@ class RegexPattern(CheckURLMixin):
|
||||
regex: Any = ...
|
||||
name: Optional[str] = ...
|
||||
converters: Dict[Any, Any] = ...
|
||||
def __init__(
|
||||
self, regex: str, name: Optional[str] = ..., is_endpoint: bool = ...
|
||||
) -> None: ...
|
||||
def match(
|
||||
self, path: str
|
||||
) -> Optional[Tuple[str, Tuple, Dict[str, str]]]: ...
|
||||
def __init__(self, regex: str, name: Optional[str] = ..., is_endpoint: bool = ...) -> None: ...
|
||||
def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[str, str]]]: ...
|
||||
def check(self) -> List[Warning]: ...
|
||||
|
||||
class RoutePattern(CheckURLMixin):
|
||||
regex: Any = ...
|
||||
name: Optional[str] = ...
|
||||
converters: Dict[str, UUIDConverter] = ...
|
||||
def __init__(
|
||||
self, route: str, name: Optional[str] = ..., is_endpoint: bool = ...
|
||||
) -> None: ...
|
||||
def match(
|
||||
self, path: str
|
||||
) -> Optional[Tuple[str, Tuple, Dict[str, Union[int, str]]]]: ...
|
||||
def __init__(self, route: str, name: Optional[str] = ..., is_endpoint: bool = ...) -> None: ...
|
||||
def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[str, Union[int, str]]]]: ...
|
||||
def check(self) -> List[Warning]: ...
|
||||
|
||||
class LocalePrefixPattern:
|
||||
@@ -78,9 +63,7 @@ class LocalePrefixPattern:
|
||||
def regex(self): ...
|
||||
@property
|
||||
def language_prefix(self) -> str: ...
|
||||
def match(
|
||||
self, path: str
|
||||
) -> Optional[Tuple[str, Tuple, Dict[Any, Any]]]: ...
|
||||
def match(self, path: str) -> Optional[Tuple[str, Tuple, Dict[Any, Any]]]: ...
|
||||
def check(self) -> List[Any]: ...
|
||||
def describe(self) -> str: ...
|
||||
|
||||
@@ -104,10 +87,7 @@ class URLPattern:
|
||||
callback: Callable,
|
||||
default_args: Optional[
|
||||
Union[
|
||||
Dict[str, Dict[str, Type[FlatPageSitemap]]],
|
||||
Dict[str, Dict[str, Sitemap]],
|
||||
Dict[str, OrderedDict],
|
||||
Dict[str, str],
|
||||
Dict[str, Dict[str, Type[FlatPageSitemap]]], Dict[str, Dict[str, Sitemap]], Dict[str, OrderedDict], Dict[str, str]
|
||||
]
|
||||
] = ...,
|
||||
name: Optional[str] = ...,
|
||||
@@ -119,10 +99,7 @@ class URLPattern:
|
||||
class URLResolver:
|
||||
url_patterns: List[Tuple[str, Callable]]
|
||||
urlconf_module: Optional[Union[List[Tuple[str, Callable]], Type[Any]]]
|
||||
pattern: Union[
|
||||
django.urls.resolvers.CheckURLMixin,
|
||||
django.urls.resolvers.LocalePrefixPattern,
|
||||
] = ...
|
||||
pattern: Union[django.urls.resolvers.CheckURLMixin, django.urls.resolvers.LocalePrefixPattern] = ...
|
||||
urlconf_name: Optional[
|
||||
Union[
|
||||
List[List[Any]],
|
||||
@@ -141,18 +118,9 @@ class URLResolver:
|
||||
self,
|
||||
pattern: Union[CheckURLMixin, LocalePrefixPattern],
|
||||
urlconf_name: Optional[
|
||||
Union[
|
||||
List[List[Any]],
|
||||
List[Tuple[str, Callable]],
|
||||
List[URLPattern],
|
||||
List[URLResolver],
|
||||
Type[Any],
|
||||
str,
|
||||
]
|
||||
Union[List[List[Any]], List[Tuple[str, Callable]], List[URLPattern], List[URLResolver], Type[Any], str]
|
||||
],
|
||||
default_kwargs: Optional[
|
||||
Union[Dict[str, Dict[Any, Any]], Dict[str, str]]
|
||||
] = ...,
|
||||
default_kwargs: Optional[Union[Dict[str, Dict[Any, Any]], Dict[str, str]]] = ...,
|
||||
app_name: Optional[str] = ...,
|
||||
namespace: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
@@ -164,11 +132,7 @@ class URLResolver:
|
||||
@property
|
||||
def app_dict(self) -> Dict[str, List[str]]: ...
|
||||
def resolve(self, path: str) -> ResolverMatch: ...
|
||||
def urlconf_module(
|
||||
self
|
||||
) -> Optional[Union[List[Tuple[str, Callable]], Type[Any]]]: ...
|
||||
def urlconf_module(self) -> Optional[Union[List[Tuple[str, Callable]], Type[Any]]]: ...
|
||||
def url_patterns(self) -> List[Tuple[str, Callable]]: ...
|
||||
def resolve_error_handler(
|
||||
self, view_type: int
|
||||
) -> Tuple[Callable, Dict[Any, Any]]: ...
|
||||
def resolve_error_handler(self, view_type: int) -> Tuple[Callable, Dict[Any, Any]]: ...
|
||||
def reverse(self, lookup_view: str, *args: Any, **kwargs: Any) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user