better stubs

This commit is contained in:
Maxim Kurnikov
2018-08-05 03:13:19 +03:00
parent 4013fe4d03
commit fa718b8e55
380 changed files with 11805 additions and 8503 deletions

View File

@@ -1,20 +1,16 @@
# Stubs for django.core.files.uploadhandler (Python 3.6)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional
from io import BytesIO
from django.core.files.uploadedfile import InMemoryUploadedFile, TemporaryUploadedFile
from django.core.handlers.wsgi import WSGIRequest
from typing import Any, Dict, Optional, Union
from django.core.files.uploadedfile import (InMemoryUploadedFile,
TemporaryUploadedFile)
from django.core.handlers.wsgi import WSGIRequest
class UploadFileException(Exception): ...
class StopUpload(UploadFileException):
connection_reset: Any = ...
connection_reset: bool = ...
def __init__(self, connection_reset: bool = ...) -> None: ...
def __str__(self): ...
class SkipFile(UploadFileException): ...
class StopFutureHandlers(UploadFileException): ...
@@ -27,10 +23,10 @@ class FileUploadHandler:
charset: Any = ...
content_type_extra: Any = ...
request: Any = ...
def __init__(self, request: WSGIRequest = ...) -> None: ...
def __init__(self, request: Optional[WSGIRequest] = ...) -> None: ...
def handle_raw_input(
self,
input_data: WSGIRequest,
input_data: Union[WSGIRequest, BytesIO],
META: Dict[str, Any],
content_length: int,
boundary: bytes,
@@ -44,23 +40,35 @@ class FileUploadHandler:
content_type: str,
content_length: None,
charset: None = ...,
content_type_extra: Dict[Any, Any] = ...,
content_type_extra: Dict[str, bytes] = ...,
) -> None: ...
def receive_data_chunk(self, raw_data: Any, start: Any) -> None: ...
def file_complete(self, file_size: Any) -> None: ...
def upload_complete(self) -> None: ...
class TemporaryFileUploadHandler(FileUploadHandler):
charset: None
content_length: None
content_type: None
content_type_extra: None
file_name: None
request: django.core.handlers.wsgi.WSGIRequest
file: Any = ...
def new_file(self, *args: Any, **kwargs: Any) -> None: ...
def receive_data_chunk(self, raw_data: bytes, start: int) -> None: ...
def file_complete(self, file_size: int) -> TemporaryUploadedFile: ...
class MemoryFileUploadHandler(FileUploadHandler):
charset: None
content_length: None
content_type: None
content_type_extra: None
file_name: None
request: django.core.handlers.wsgi.WSGIRequest
activated: Any = ...
def handle_raw_input(
self,
input_data: Union[BytesIO, WSGIRequest],
input_data: Union[WSGIRequest, BytesIO],
META: Dict[str, Any],
content_length: int,
boundary: bytes,
@@ -68,7 +76,11 @@ class MemoryFileUploadHandler(FileUploadHandler):
) -> None: ...
file: Any = ...
def new_file(self, *args: Any, **kwargs: Any) -> None: ...
def receive_data_chunk(self, raw_data: bytes, start: int) -> Optional[bytes]: ...
def file_complete(self, file_size: int) -> Optional[InMemoryUploadedFile]: ...
def receive_data_chunk(
self, raw_data: bytes, start: int
) -> Optional[bytes]: ...
def file_complete(
self, file_size: int
) -> Optional[InMemoryUploadedFile]: ...
def load_handler(path: str, *args: Any, **kwargs: Any) -> FileUploadHandler: ...