Files
django-stubs/django/contrib/staticfiles/storage.pyi
Maxim Kurnikov a9f215bf64 initial commit
2018-07-29 18:12:23 +03:00

82 lines
2.6 KiB
Python

from collections import OrderedDict
from django.core.cache import DefaultCacheProxy
from django.core.files.base import File
from django.core.files.storage import FileSystemStorage
from django.utils.safestring import SafeText
from typing import (
Callable,
Dict,
Iterator,
List,
Optional,
Tuple,
Union,
)
class CachedFilesMixin:
def __init__(self, *args, **kwargs) -> None: ...
def hash_key(self, name: str) -> str: ...
class ConfiguredStorage:
def _setup(self) -> None: ...
class HashedFilesMixin:
def __init__(self, *args, **kwargs) -> None: ...
def _post_process(
self,
paths: Union[OrderedDict, Dict[str, Tuple[FileSystemStorage, str]]],
adjustable_paths: List[str],
hashed_files: OrderedDict
) -> Iterator[Tuple[str, str, bool, bool]]: ...
def _stored_name(self, name: str, hashed_files: OrderedDict) -> str: ...
def _url(
self,
hashed_name_func: Callable,
name: str,
force: bool = ...,
hashed_files: Optional[OrderedDict] = ...
) -> str: ...
def clean_name(self, name: str) -> str: ...
def file_hash(self, name: str, content: File = ...) -> str: ...
def hash_key(self, name: str) -> str: ...
def hashed_name(
self,
name: str,
content: Optional[File] = ...,
filename: Optional[str] = ...
) -> str: ...
def post_process(
self,
paths: OrderedDict,
dry_run: bool = ...,
**options
) -> Iterator[Tuple[str, str, bool]]: ...
def stored_name(self, name: SafeText) -> str: ...
def url(self, name: SafeText, force: bool = ...) -> str: ...
def url_converter(self, name: str, hashed_files: OrderedDict, template: str = ...) -> Callable: ...
class ManifestFilesMixin:
def __init__(self, *args, **kwargs) -> None: ...
def load_manifest(self) -> OrderedDict: ...
def post_process(self, *args, **kwargs) -> None: ...
def read_manifest(self) -> None: ...
def save_manifest(self) -> None: ...
def stored_name(self, name: SafeText) -> str: ...
class StaticFilesStorage:
def __init__(self, location: Optional[str] = ..., base_url: None = ..., *args, **kwargs) -> None: ...
def path(self, name: str) -> str: ...
class _MappingCache:
def __getitem__(self, key: str) -> str: ...
def __init__(self, cache: DefaultCacheProxy) -> None: ...
def __setitem__(self, key: str, value: str) -> None: ...
def clear(self) -> None: ...
def get(self, key: str, default: None = ...) -> Optional[str]: ...
def update(self, data: OrderedDict) -> None: ...