mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-10-24 22:57:26 +08:00
merge with stubgen output
This commit is contained in:
1 parent
496a6274e7
commit
4866354600
294 files changed
+10234
-10842
No files matched your search
@@ -1,36 +1,39 @@
|
||||
from typing import (
|
||||
Any,
|
||||
Iterator,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
# Stubs for django.core.files.base (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.core.files.utils import FileProxyMixin
|
||||
from typing import Any, Optional
|
||||
|
||||
def endswith_cr(line: bytes) -> bool: ...
|
||||
|
||||
|
||||
def endswith_lf(line: Union[str, bytes]) -> bool: ...
|
||||
|
||||
|
||||
def equals_lf(line: bytes) -> bool: ...
|
||||
|
||||
|
||||
class ContentFile:
|
||||
def __bool__(self) -> bool: ...
|
||||
def __init__(self, content: Union[str, bytes], name: Optional[str] = ...) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
|
||||
class File:
|
||||
from typing import Any, Iterator, Optional, Union
|
||||
class File(FileProxyMixin):
|
||||
DEFAULT_CHUNK_SIZE: Any = ...
|
||||
file: Any = ...
|
||||
name: Any = ...
|
||||
mode: Any = ...
|
||||
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
def size(self) -> int: ...
|
||||
def chunks(self, chunk_size: None = ...) -> Iterator[Union[str, bytes]]: ...
|
||||
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
|
||||
def __iter__(self) -> Iterator[Union[str, bytes]]: ...
|
||||
def __enter__(self) -> File: ...
|
||||
def __exit__(self, exc_type: None, exc_value: None, tb: None) -> None: ...
|
||||
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
|
||||
def __iter__(self) -> Iterator[Union[str, bytes]]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __str__(self) -> str: ...
|
||||
def chunks(self, chunk_size: None = ...) -> Iterator[Union[str, bytes]]: ...
|
||||
def open(self, mode: Optional[Any] = ...): ...
|
||||
def close(self) -> None: ...
|
||||
@cached_property
|
||||
def size(self) -> int: ...
|
||||
|
||||
class ContentFile(File):
|
||||
size: Any = ...
|
||||
def __init__(self, content: Union[str, bytes], name: Optional[str] = ...) -> None: ...
|
||||
def __str__(self): ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def open(self, mode: Optional[Any] = ...): ...
|
||||
def close(self) -> None: ...
|
||||
def write(self, data: Any): ...
|
||||
|
||||
def endswith_cr(line: bytes) -> bool: ...
|
||||
def endswith_lf(line: Union[str, bytes]) -> bool: ...
|
||||
def equals_lf(line: bytes) -> bool: ...
|
||||
@@ -1,57 +1,38 @@
|
||||
from io import (
|
||||
BytesIO,
|
||||
StringIO,
|
||||
)
|
||||
# Stubs for django.core.files.uploadedfile (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.core.files.base import File
|
||||
from typing import Any, Optional
|
||||
|
||||
from io import BytesIO, StringIO
|
||||
from tempfile import _TemporaryFileWrapper
|
||||
from typing import (
|
||||
Iterator,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class InMemoryUploadedFile:
|
||||
def __init__(
|
||||
self,
|
||||
file: Union[StringIO, BytesIO],
|
||||
field_name: Optional[str],
|
||||
name: str,
|
||||
content_type: str,
|
||||
size: int,
|
||||
charset: Optional[str],
|
||||
content_type_extra: None = ...
|
||||
) -> None: ...
|
||||
def chunks(self, chunk_size: None = ...) -> Iterator[Union[str, bytes]]: ...
|
||||
def open(self, mode: None = ...) -> InMemoryUploadedFile: ...
|
||||
|
||||
|
||||
class SimpleUploadedFile:
|
||||
def __init__(self, name: str, content: Optional[bytes], content_type: str = ...) -> None: ...
|
||||
|
||||
|
||||
class TemporaryUploadedFile:
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
content_type: str,
|
||||
size: int,
|
||||
charset: str,
|
||||
content_type_extra: None = ...
|
||||
) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def temporary_file_path(self) -> str: ...
|
||||
|
||||
|
||||
class UploadedFile:
|
||||
def __init__(
|
||||
self,
|
||||
file: Optional[Union[StringIO, _TemporaryFileWrapper, BytesIO]] = ...,
|
||||
name: str = ...,
|
||||
content_type: str = ...,
|
||||
size: Optional[int] = ...,
|
||||
charset: Optional[str] = ...,
|
||||
content_type_extra: None = ...
|
||||
) -> None: ...
|
||||
from typing import Iterator, Optional, Union
|
||||
class UploadedFile(File):
|
||||
size: Any = ...
|
||||
content_type: Any = ...
|
||||
charset: Any = ...
|
||||
content_type_extra: Any = ...
|
||||
def __init__(self, file: Optional[Union[StringIO, _TemporaryFileWrapper, BytesIO]] = ..., name: str = ..., content_type: str = ..., size: Optional[int] = ..., charset: Optional[str] = ..., content_type_extra: None = ...) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def _get_name(self) -> str: ...
|
||||
def _set_name(self, name: str) -> None: ...
|
||||
_name: Any = ...
|
||||
def _set_name(self, name: str) -> None: ...
|
||||
name: Any = ...
|
||||
|
||||
class TemporaryUploadedFile(UploadedFile):
|
||||
def __init__(self, name: str, content_type: str, size: int, charset: str, content_type_extra: None = ...) -> None: ...
|
||||
def temporary_file_path(self) -> str: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class InMemoryUploadedFile(UploadedFile):
|
||||
field_name: Any = ...
|
||||
def __init__(self, file: Union[StringIO, BytesIO], field_name: Optional[str], name: str, content_type: str, size: int, charset: Optional[str], content_type_extra: None = ...) -> None: ...
|
||||
def open(self, mode: None = ...) -> InMemoryUploadedFile: ...
|
||||
def chunks(self, chunk_size: None = ...) -> Iterator[Union[str, bytes]]: ...
|
||||
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
|
||||
|
||||
class SimpleUploadedFile(InMemoryUploadedFile):
|
||||
def __init__(self, name: str, content: Optional[bytes], content_type: str = ...) -> None: ...
|
||||
@classmethod
|
||||
def from_dict(cls, file_dict: Any): ...
|
||||
@@ -1,57 +1,51 @@
|
||||
# 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.files.uploadedfile import InMemoryUploadedFile, TemporaryUploadedFile
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
from typing import Any, Dict, Optional, Union
|
||||
class UploadFileException(Exception): ...
|
||||
|
||||
class StopUpload(UploadFileException):
|
||||
connection_reset: Any = ...
|
||||
def __init__(self, connection_reset: bool = ...) -> None: ...
|
||||
def __str__(self): ...
|
||||
|
||||
def load_handler(path: str, *args, **kwargs) -> FileUploadHandler: ...
|
||||
|
||||
class SkipFile(UploadFileException): ...
|
||||
class StopFutureHandlers(UploadFileException): ...
|
||||
|
||||
class FileUploadHandler:
|
||||
chunk_size: Any = ...
|
||||
file_name: Any = ...
|
||||
content_type: Any = ...
|
||||
content_length: Any = ...
|
||||
charset: Any = ...
|
||||
content_type_extra: Any = ...
|
||||
request: Any = ...
|
||||
def __init__(self, request: WSGIRequest = ...) -> None: ...
|
||||
def handle_raw_input(
|
||||
self,
|
||||
input_data: WSGIRequest,
|
||||
META: Dict[str, Any],
|
||||
content_length: int,
|
||||
boundary: bytes,
|
||||
encoding: str = ...
|
||||
) -> None: ...
|
||||
def new_file(
|
||||
self,
|
||||
field_name: str,
|
||||
file_name: str,
|
||||
content_type: str,
|
||||
content_length: None,
|
||||
charset: None = ...,
|
||||
content_type_extra: Dict[Any, Any] = ...
|
||||
) -> None: ...
|
||||
def handle_raw_input(self, input_data: WSGIRequest, META: Dict[str, Any], content_length: int, boundary: bytes, encoding: str = ...) -> None: ...
|
||||
field_name: Any = ...
|
||||
def new_file(self, field_name: str, file_name: str, content_type: str, content_length: None, charset: None = ..., content_type_extra: Dict[Any, Any] = ...) -> 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 MemoryFileUploadHandler:
|
||||
def file_complete(self, file_size: int) -> Optional[InMemoryUploadedFile]: ...
|
||||
def handle_raw_input(
|
||||
self,
|
||||
input_data: Union[BytesIO, WSGIRequest],
|
||||
META: Dict[str, Any],
|
||||
content_length: int,
|
||||
boundary: bytes,
|
||||
encoding: str = ...
|
||||
) -> None: ...
|
||||
def new_file(self, *args, **kwargs) -> None: ...
|
||||
def receive_data_chunk(self, raw_data: bytes, start: int) -> Optional[bytes]: ...
|
||||
|
||||
|
||||
class TemporaryFileUploadHandler:
|
||||
class TemporaryFileUploadHandler(FileUploadHandler):
|
||||
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: ...
|
||||
def new_file(self, *args, **kwargs) -> None: ...
|
||||
def receive_data_chunk(self, raw_data: bytes, start: int) -> None: ...
|
||||
|
||||
class MemoryFileUploadHandler(FileUploadHandler):
|
||||
activated: Any = ...
|
||||
def handle_raw_input(self, input_data: Union[BytesIO, WSGIRequest], META: Dict[str, Any], content_length: int, boundary: bytes, encoding: str = ...) -> 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 load_handler(path: str, *args: Any, **kwargs: Any) -> FileUploadHandler: ...
|
||||
@@ -1,4 +1,27 @@
|
||||
# Stubs for django.core.files.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class FileProxyMixin:
|
||||
encoding: Any = ...
|
||||
fileno: Any = ...
|
||||
flush: Any = ...
|
||||
isatty: Any = ...
|
||||
newlines: Any = ...
|
||||
read: Any = ...
|
||||
readinto: Any = ...
|
||||
readline: Any = ...
|
||||
readlines: Any = ...
|
||||
seek: Any = ...
|
||||
tell: Any = ...
|
||||
truncate: Any = ...
|
||||
write: Any = ...
|
||||
writelines: Any = ...
|
||||
@property
|
||||
def closed(self) -> bool: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readable(self) -> bool: ...
|
||||
def writable(self): ...
|
||||
def seekable(self): ...
|
||||
def __iter__(self): ...
|
||||
Reference in new issue
Block a user