mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 14:01:56 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class StaticFilesConfig(AppConfig):
|
||||
apps: None
|
||||
label: str
|
||||
|
||||
@@ -2,5 +2,4 @@ from typing import Any, List, Optional
|
||||
|
||||
from django.core.checks.messages import Error
|
||||
|
||||
|
||||
def check_finders(app_configs: None = ..., **kwargs: Any) -> List[Error]: ...
|
||||
|
||||
@@ -14,44 +14,27 @@ class BaseFinder:
|
||||
class FileSystemFinder(BaseFinder):
|
||||
locations: List[Any] = ...
|
||||
storages: collections.OrderedDict = ...
|
||||
def __init__(
|
||||
self, app_names: None = ..., *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
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]]: ...
|
||||
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: collections.OrderedDict = ...
|
||||
def __init__(
|
||||
self, app_names: None = ..., *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
def list(
|
||||
self, ignore_patterns: List[str]
|
||||
) -> Iterator[Tuple[str, FileSystemStorage]]: ...
|
||||
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: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
storage: Optional[StaticFilesStorage] = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def __init__(self, storage: Optional[StaticFilesStorage] = ..., *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]]: ...
|
||||
def list(self, ignore_patterns: List[str]) -> Iterator[Tuple[str, DefaultStorage]]: ...
|
||||
|
||||
class DefaultStorageFinder(BaseStorageFinder):
|
||||
storage: django.contrib.staticfiles.storage.StaticFilesStorage = ...
|
||||
|
||||
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIHandler, WSGIRequest
|
||||
|
||||
|
||||
class StaticFilesHandler(WSGIHandler):
|
||||
handles_files: bool = ...
|
||||
application: django.core.handlers.wsgi.WSGIHandler = ...
|
||||
|
||||
@@ -3,7 +3,6 @@ from typing import Any, Dict, List, Optional
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.core.management.base import BaseCommand, CommandParser
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
stderr: django.core.management.base.OutputWrapper
|
||||
stdout: django.core.management.base.OutputWrapper
|
||||
@@ -31,12 +30,6 @@ class Command(BaseCommand):
|
||||
def log(self, msg: str, level: int = ...) -> None: ...
|
||||
def is_local_storage(self) -> bool: ...
|
||||
def clear_dir(self, path: str) -> None: ...
|
||||
def delete_file(
|
||||
self, path: str, prefixed_path: str, source_storage: FileSystemStorage
|
||||
) -> bool: ...
|
||||
def link_file(
|
||||
self, path: str, prefixed_path: str, source_storage: FileSystemStorage
|
||||
) -> None: ...
|
||||
def copy_file(
|
||||
self, path: str, prefixed_path: str, source_storage: FileSystemStorage
|
||||
) -> None: ...
|
||||
def delete_file(self, path: str, prefixed_path: str, source_storage: FileSystemStorage) -> bool: ...
|
||||
def link_file(self, path: str, prefixed_path: str, source_storage: FileSystemStorage) -> None: ...
|
||||
def copy_file(self, path: str, prefixed_path: str, source_storage: FileSystemStorage) -> None: ...
|
||||
|
||||
@@ -2,7 +2,6 @@ from typing import Any, Optional
|
||||
|
||||
from django.core.management.base import CommandParser, LabelCommand
|
||||
|
||||
|
||||
class Command(LabelCommand):
|
||||
stderr: django.core.management.base.OutputWrapper
|
||||
stdout: django.core.management.base.OutputWrapper
|
||||
|
||||
@@ -2,9 +2,7 @@ from typing import Any, Optional
|
||||
|
||||
from django.contrib.staticfiles.handlers import StaticFilesHandler
|
||||
from django.core.management.base import CommandParser
|
||||
from django.core.management.commands.runserver import \
|
||||
Command as RunserverCommand
|
||||
|
||||
from django.core.management.commands.runserver import Command as RunserverCommand
|
||||
|
||||
class Command(RunserverCommand):
|
||||
stderr: django.core.management.base.OutputWrapper
|
||||
|
||||
@@ -6,17 +6,10 @@ from django.core.files.storage import FileSystemStorage
|
||||
from django.utils.functional import LazyObject
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
|
||||
class StaticFilesStorage(FileSystemStorage):
|
||||
base_location: Any = ...
|
||||
location: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
location: Optional[str] = ...,
|
||||
base_url: None = ...,
|
||||
*args: Any,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def __init__(self, location: Optional[str] = ..., base_url: None = ..., *args: Any, **kwargs: Any) -> None: ...
|
||||
def path(self, name: str) -> str: ...
|
||||
|
||||
class HashedFilesMixin:
|
||||
@@ -26,19 +19,10 @@ class HashedFilesMixin:
|
||||
hashed_files: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def file_hash(self, name: str, content: File = ...) -> str: ...
|
||||
def hashed_name(
|
||||
self,
|
||||
name: str,
|
||||
content: Optional[File] = ...,
|
||||
filename: Optional[str] = ...,
|
||||
) -> str: ...
|
||||
def hashed_name(self, name: str, content: Optional[File] = ..., filename: Optional[str] = ...) -> str: ...
|
||||
def url(self, name: SafeText, force: bool = ...) -> str: ...
|
||||
def url_converter(
|
||||
self, name: str, hashed_files: OrderedDict, template: str = ...
|
||||
) -> Callable: ...
|
||||
def post_process(
|
||||
self, paths: OrderedDict, dry_run: bool = ..., **options: Any
|
||||
) -> Iterator[Tuple[str, str, bool]]: ...
|
||||
def url_converter(self, name: str, hashed_files: OrderedDict, template: str = ...) -> Callable: ...
|
||||
def post_process(self, paths: OrderedDict, dry_run: bool = ..., **options: Any) -> Iterator[Tuple[str, str, bool]]: ...
|
||||
def clean_name(self, name: str) -> str: ...
|
||||
def hash_key(self, name: str) -> str: ...
|
||||
def stored_name(self, name: str) -> str: ...
|
||||
|
||||
@@ -3,13 +3,6 @@ from typing import Any, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
|
||||
|
||||
def matches_patterns(
|
||||
path: str, patterns: Union[List[str], Tuple[str], OrderedDict] = ...
|
||||
) -> bool: ...
|
||||
def get_files(
|
||||
storage: FileSystemStorage,
|
||||
ignore_patterns: List[str] = ...,
|
||||
location: str = ...,
|
||||
) -> Iterator[str]: ...
|
||||
def matches_patterns(path: str, patterns: Union[List[str], Tuple[str], OrderedDict] = ...) -> bool: ...
|
||||
def get_files(storage: FileSystemStorage, ignore_patterns: List[str] = ..., location: str = ...) -> Iterator[str]: ...
|
||||
def check_settings(base_url: Optional[str] = ...) -> None: ...
|
||||
|
||||
@@ -3,7 +3,4 @@ from typing import Any, Optional
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import FileResponse
|
||||
|
||||
|
||||
def serve(
|
||||
request: WSGIRequest, path: str, insecure: bool = ..., **kwargs: Any
|
||||
) -> FileResponse: ...
|
||||
def serve(request: WSGIRequest, path: str, insecure: bool = ..., **kwargs: Any) -> FileResponse: ...
|
||||
|
||||
Reference in New Issue
Block a user