mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 05:24:53 +08:00
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
from io import BufferedReader, StringIO
|
|
from typing import Any, Iterator, Optional, Union
|
|
|
|
from django.core.files.utils import FileProxyMixin
|
|
|
|
class File(FileProxyMixin):
|
|
DEFAULT_CHUNK_SIZE: Any = ...
|
|
file: StringIO = ...
|
|
name: Optional[str] = ...
|
|
mode: str = ...
|
|
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
|
|
def __bool__(self) -> bool: ...
|
|
def __len__(self) -> int: ...
|
|
def size(self) -> int: ...
|
|
def chunks(self, chunk_size: Optional[int] = ...) -> Iterator[Union[bytes, bytearray]]: ...
|
|
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
|
|
def __iter__(self) -> Iterator[Union[bytes, str]]: ...
|
|
def __enter__(self) -> File: ...
|
|
def __exit__(self, exc_type: None, exc_value: None, tb: None) -> None: ...
|
|
def open(self, mode: Optional[str] = ...) -> File: ...
|
|
def close(self) -> None: ...
|
|
|
|
class ContentFile(File):
|
|
file: StringIO
|
|
size: Any = ...
|
|
def __init__(self, content: Union[bytes, str], name: Optional[str] = ...) -> None: ...
|
|
def __bool__(self) -> bool: ...
|
|
def open(self, mode: Optional[str] = ...) -> ContentFile: ...
|
|
def close(self) -> None: ...
|
|
def write(self, data: str) -> int: ...
|
|
|
|
def endswith_cr(line: bytes) -> bool: ...
|
|
def endswith_lf(line: Union[bytes, str]) -> bool: ...
|
|
def equals_lf(line: bytes) -> bool: ...
|