mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-11 06:21:58 +08:00
better stubs
This commit is contained in:
42
django-stubs/core/cache/backends/filebased.pyi
vendored
42
django-stubs/core/cache/backends/filebased.pyi
vendored
@@ -1,26 +1,24 @@
|
||||
# Stubs for django.core.cache.backends.filebased (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Callable, Dict, Optional, Union
|
||||
|
||||
from django.core.cache.backends.base import BaseCache
|
||||
from typing import Any, Optional
|
||||
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
|
||||
def _write_content(
|
||||
f: Union[BufferedRandom, BufferedWriter], expiry: float, value: object
|
||||
) -> None: ...
|
||||
|
||||
class FileBasedCache(BaseCache):
|
||||
default_timeout: int
|
||||
key_func: Callable
|
||||
key_prefix: str
|
||||
version: int
|
||||
cache_suffix: str = ...
|
||||
_dir: Any = ...
|
||||
def __init__(self, dir: str, params: Dict[str, Union[Callable, int]]) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
dir: str,
|
||||
params: Dict[str, Union[Dict[str, int], Callable, str, int]],
|
||||
) -> None: ...
|
||||
def add(
|
||||
self,
|
||||
key: str,
|
||||
value: Union[str, bytes, int],
|
||||
timeout: object = ...,
|
||||
value: Union[int, bytes, str, Dict[str, int]],
|
||||
timeout: Any = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> bool: ...
|
||||
def get(
|
||||
@@ -30,15 +28,15 @@ class FileBasedCache(BaseCache):
|
||||
version: Optional[int] = ...,
|
||||
) -> Optional[str]: ...
|
||||
def set(
|
||||
self, key: str, value: Any, timeout: object = ..., version: Optional[int] = ...
|
||||
self,
|
||||
key: str,
|
||||
value: Any,
|
||||
timeout: Any = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> None: ...
|
||||
def touch(self, key: str, timeout: object = ..., version: None = ...): ...
|
||||
def touch(
|
||||
self, key: str, timeout: Any = ..., version: None = ...
|
||||
) -> bool: ...
|
||||
def delete(self, key: str, version: Optional[int] = ...) -> None: ...
|
||||
def _delete(self, fname: str) -> None: ...
|
||||
def has_key(self, key: str, version: Optional[int] = ...) -> bool: ...
|
||||
def _cull(self) -> None: ...
|
||||
def _createdir(self) -> None: ...
|
||||
def _key_to_file(self, key: str, version: Optional[int] = ...) -> str: ...
|
||||
def clear(self) -> None: ...
|
||||
def _is_expired(self, f: BufferedReader) -> bool: ...
|
||||
def _list_cache_files(self) -> List[str]: ...
|
||||
|
||||
Reference in New Issue
Block a user