mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-09-21 03:03:18 +08:00
fourth iteration
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
from http.client import HTTPResponse
|
||||
from io import (BufferedRandom, BufferedReader, BufferedWriter, BytesIO,
|
||||
StringIO, TextIOWrapper)
|
||||
from tempfile import SpooledTemporaryFile, _TemporaryFileWrapper
|
||||
from typing import Any, Iterator, Optional, Union
|
||||
|
||||
from django.core.files.utils import FileProxyMixin
|
||||
@@ -12,23 +8,7 @@ class File(FileProxyMixin):
|
||||
file: _io.BufferedReader = ...
|
||||
name: str = ...
|
||||
mode: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
file: Optional[
|
||||
Union[
|
||||
BufferedRandom,
|
||||
BufferedReader,
|
||||
BufferedWriter,
|
||||
BytesIO,
|
||||
StringIO,
|
||||
TextIOWrapper,
|
||||
HTTPResponse,
|
||||
SpooledTemporaryFile,
|
||||
_TemporaryFileWrapper,
|
||||
]
|
||||
],
|
||||
name: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
def size(self) -> int: ...
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
from io import BytesIO
|
||||
from typing import Any, Dict, Optional, Tuple, Union
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
from django.core.files.uploadedfile import (InMemoryUploadedFile,
|
||||
TemporaryUploadedFile)
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.test.client import FakePayload
|
||||
|
||||
|
||||
class UploadFileException(Exception): ...
|
||||
@@ -28,12 +27,7 @@ class FileUploadHandler:
|
||||
def handle_raw_input(
|
||||
self,
|
||||
input_data: Union[BytesIO, WSGIRequest],
|
||||
META: Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
||||
],
|
||||
],
|
||||
META: Dict[str, Any],
|
||||
content_length: int,
|
||||
boundary: bytes,
|
||||
encoding: str = ...,
|
||||
@@ -75,12 +69,7 @@ class MemoryFileUploadHandler(FileUploadHandler):
|
||||
def handle_raw_input(
|
||||
self,
|
||||
input_data: Union[BytesIO, WSGIRequest],
|
||||
META: Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, str], Tuple[int, int], BytesIO, FakePayload, int, str
|
||||
],
|
||||
],
|
||||
META: Dict[str, Any],
|
||||
content_length: int,
|
||||
boundary: bytes,
|
||||
encoding: str = ...,
|
||||
|
||||
Reference in New Issue
Block a user