mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 08:17:08 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -10,10 +10,6 @@ logger: Any
|
||||
class BaseHandler:
|
||||
def load_middleware(self) -> None: ...
|
||||
def make_view_atomic(self, view: Callable) -> Callable: ...
|
||||
def get_exception_response(
|
||||
self, request: Any, resolver: Any, status_code: Any, exception: Any
|
||||
): ...
|
||||
def get_exception_response(self, request: Any, resolver: Any, status_code: Any, exception: Any): ...
|
||||
def get_response(self, request: WSGIRequest) -> HttpResponseBase: ...
|
||||
def process_exception_by_middleware(
|
||||
self, exception: Exception, request: WSGIRequest
|
||||
) -> HttpResponse: ...
|
||||
def process_exception_by_middleware(self, exception: Exception, request: WSGIRequest) -> HttpResponse: ...
|
||||
|
||||
@@ -4,16 +4,9 @@ from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
from django.urls.resolvers import URLResolver
|
||||
|
||||
|
||||
def convert_exception_to_response(get_response: Callable) -> Callable: ...
|
||||
def response_for_exception(
|
||||
request: WSGIRequest, exc: Exception
|
||||
) -> HttpResponse: ...
|
||||
def response_for_exception(request: WSGIRequest, exc: Exception) -> HttpResponse: ...
|
||||
def get_exception_response(
|
||||
request: WSGIRequest,
|
||||
resolver: URLResolver,
|
||||
status_code: int,
|
||||
exception: Exception,
|
||||
sender: None = ...,
|
||||
request: WSGIRequest, resolver: URLResolver, status_code: int, exception: Exception, sender: None = ...
|
||||
) -> HttpResponse: ...
|
||||
def handle_uncaught_exception(request: Any, resolver: Any, exc_info: Any): ...
|
||||
|
||||
@@ -9,28 +9,17 @@ from django.http.request import QueryDict
|
||||
from django.http.response import HttpResponse
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
|
||||
|
||||
_Stream = Union[BytesIO, str]
|
||||
|
||||
|
||||
class LimitedStream:
|
||||
stream: _Stream = ...
|
||||
remaining: int = ...
|
||||
buffer: bytes = ...
|
||||
buf_size: int = ...
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
stream: _Stream,
|
||||
limit: int,
|
||||
buf_size: int = ...,
|
||||
) -> None: ...
|
||||
|
||||
def __init__(self, stream: _Stream, limit: int, buf_size: int = ...) -> None: ...
|
||||
def read(self, size: Optional[int] = ...) -> bytes: ...
|
||||
|
||||
def readline(self, size: Optional[int] = ...) -> bytes: ...
|
||||
|
||||
|
||||
class WSGIRequest(HttpRequest):
|
||||
content_params: Dict[str, str]
|
||||
content_type: str
|
||||
@@ -44,42 +33,19 @@ class WSGIRequest(HttpRequest):
|
||||
method: str = ...
|
||||
encoding: Any = ...
|
||||
resolver_match: None = ...
|
||||
|
||||
def __init__(self, environ: Dict[str, Any]) -> None: ...
|
||||
|
||||
def GET(self) -> QueryDict: ...
|
||||
|
||||
def COOKIES(self) -> Dict[str, str]: ...
|
||||
|
||||
@property
|
||||
def FILES(self) -> MultiValueDict: ...
|
||||
|
||||
POST: Any = ...
|
||||
|
||||
|
||||
class WSGIHandler(base.BaseHandler):
|
||||
request_class: Any = ...
|
||||
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
environ: Dict[str, Any],
|
||||
start_response: Callable,
|
||||
) -> HttpResponse: ...
|
||||
|
||||
def __call__(self, environ: Dict[str, Any], start_response: Callable) -> HttpResponse: ...
|
||||
|
||||
def get_path_info(environ: Dict[str, Any]) -> str: ...
|
||||
|
||||
|
||||
def get_script_name(environ: Dict[str, Any]) -> str: ...
|
||||
|
||||
|
||||
def get_bytes_from_wsgi(
|
||||
environ: Dict[str, Any], key: str, default: str
|
||||
) -> bytes: ...
|
||||
|
||||
|
||||
def get_str_from_wsgi(
|
||||
environ: Dict[str, Any], key: str, default: str
|
||||
) -> str: ...
|
||||
def get_bytes_from_wsgi(environ: Dict[str, Any], key: str, default: str) -> bytes: ...
|
||||
def get_str_from_wsgi(environ: Dict[str, Any], key: str, default: str) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user