mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-07 20:54:29 +08:00
52 lines
2.3 KiB
Python
52 lines
2.3 KiB
Python
from typing import Any, Iterator, List, Optional, Tuple, Union, Mapping, overload
|
|
|
|
from django.contrib.staticfiles.storage import StaticFilesStorage
|
|
from django.core.checks.messages import Error
|
|
from django.core.files.storage import DefaultStorage, FileSystemStorage, Storage
|
|
from typing_extensions import Literal
|
|
|
|
searched_locations: Any
|
|
|
|
class BaseFinder:
|
|
def check(self, **kwargs: Any) -> Any: ...
|
|
def find(self, path: Any, all: bool = ...) -> None: ...
|
|
def list(self, ignore_patterns: Any) -> None: ...
|
|
|
|
class FileSystemFinder(BaseFinder):
|
|
locations: List[Any] = ...
|
|
storages: Mapping[str, Any] = ...
|
|
def __init__(self, app_names: None = ..., *args: Any, **kwargs: Any) -> None: ...
|
|
def check(self, **kwargs: Any) -> List[Error]: ...
|
|
def find(self, path: str, all: bool = ...) -> Union[List[str], str]: ...
|
|
def find_location(self, root: str, path: str, prefix: str = ...) -> Optional[str]: ...
|
|
def list(self, ignore_patterns: List[str]) -> Iterator[Tuple[str, FileSystemStorage]]: ...
|
|
|
|
class AppDirectoriesFinder(BaseFinder):
|
|
storage_class: Any = ...
|
|
source_dir: str = ...
|
|
apps: List[str] = ...
|
|
storages: Mapping[str, Any] = ...
|
|
def __init__(self, app_names: None = ..., *args: Any, **kwargs: Any) -> None: ...
|
|
def list(self, ignore_patterns: List[str]) -> Iterator[Tuple[str, FileSystemStorage]]: ...
|
|
def find(self, path: str, all: bool = ...) -> Union[List[str], str]: ...
|
|
def find_in_app(self, app: str, path: str) -> Optional[str]: ...
|
|
|
|
class BaseStorageFinder(BaseFinder):
|
|
storage: Storage = ...
|
|
def __init__(self, storage: Optional[Storage] = ..., *args: Any, **kwargs: Any) -> None: ...
|
|
def find(self, path: str, all: bool = ...) -> Union[List[str], str]: ...
|
|
def list(self, ignore_patterns: List[str]) -> Iterator[Tuple[str, DefaultStorage]]: ...
|
|
|
|
class DefaultStorageFinder(BaseStorageFinder): ...
|
|
|
|
def find(path: str, all: bool = ...) -> Optional[Union[List[str], str]]: ...
|
|
def get_finders() -> Iterator[BaseFinder]: ...
|
|
@overload
|
|
def get_finder(import_path: Literal["django.contrib.staticfiles.finders.FileSystemFinder"]) -> FileSystemFinder: ...
|
|
@overload
|
|
def get_finder(
|
|
import_path: Literal["django.contrib.staticfiles.finders.AppDirectoriesFinder"]
|
|
) -> AppDirectoriesFinder: ...
|
|
@overload
|
|
def get_finder(import_path: str) -> BaseFinder: ...
|