-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
74 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
from datetime import datetime | ||
from typing import IO | ||
|
||
class BaseCache: | ||
def get(self, key: str) -> str | None: ... | ||
def set(self, key: str, value: str) -> None: ... | ||
def get(self, key: str) -> bytes | None: ... | ||
def set(self, key: str, value: bytes, expires: int | datetime | None = None) -> None: ... | ||
def delete(self, key: str) -> None: ... | ||
def close(self) -> None: ... | ||
|
||
class SeparateBodyBaseCache(BaseCache): | ||
def set_body(self, key: str, body: bytes) -> None: ... | ||
def get_body(self, key: str) -> IO[bytes] | None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
# Stubs for cachecontrol.caches (Python 2) | ||
# | ||
# NOTE: This dynamically typed stub was automatically generated by stubgen. | ||
from cachecontrol.caches.file_cache import ( | ||
SeparateBodyFileCache as SeparateBodyFileCache, | ||
) | ||
|
||
from typing import Any | ||
|
||
from .file_cache import FileCache as FileCache | ||
|
||
# from .redis_cache import RedisCache as RedisCache | ||
|
||
notice = ... # type: Any | ||
__all__ = ["SeparateBodyFileCache"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
from os import PathLike | ||
from typing import ContextManager | ||
from datetime import datetime | ||
from pathlib import Path | ||
from typing import IO, ContextManager | ||
|
||
from ..cache import BaseCache as BaseCache | ||
from ..controller import CacheController as CacheController | ||
from cachecontrol.cache import SeparateBodyBaseCache | ||
from filelock import BaseFileLock | ||
|
||
class _LockClass: | ||
path: str | ||
|
||
_lock_class = ContextManager[_LockClass] | ||
|
||
class FileCache(BaseCache): | ||
directory: str | PathLike[str] | ||
class _FileCacheMixin: | ||
directory: str | ||
forever: bool | ||
filemode: str | ||
dirmode: str | ||
lock_class: _lock_class | ||
filemode: int | ||
dirmode: int | ||
lock_class: _lock_class | None = None | ||
def __init__( | ||
self, | ||
directory: str | PathLike[str], | ||
forever: bool = ..., | ||
filemode: int = ..., | ||
dirmode: int = ..., | ||
use_dir_lock: bool | None = ..., | ||
lock_class: _lock_class | None = ..., | ||
directory: str | Path, | ||
forever: bool = False, | ||
filemode: int = 384, | ||
dirmode: int = 448, | ||
lock_class: type[BaseFileLock] | None = None, | ||
) -> None: ... | ||
@staticmethod | ||
def encode(x: str) -> str: ... | ||
def get(self, key: str) -> None | str: ... | ||
def set(self, key: str, value: str) -> None: ... | ||
def get(self, key: str) -> bytes | None: ... | ||
def set(self, key: str, value: bytes, expires: int | datetime | None = None) -> None: ... | ||
|
||
class SeparateBodyFileCache(_FileCacheMixin, SeparateBodyBaseCache): | ||
def get_body(self, key: str) -> IO[bytes] | None: ... | ||
def set_body(self, key: str, body: bytes) -> None: ... | ||
def delete(self, key: str) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
from typing import Collection | ||
|
||
from _typeshed import Incomplete | ||
|
||
logger: Incomplete | ||
URI: Incomplete | ||
from .cache import BaseCache | ||
|
||
class CacheController: | ||
cache: Incomplete | ||
cache_etags: Incomplete | ||
cache: BaseCache | ||
cache_etags: bool | ||
serializer: Incomplete | ||
cacheable_status_codes: Incomplete | ||
cacheable_status_codes: Collection[int] | None = None | ||
def __init__( | ||
self, | ||
cache: Incomplete | None = ..., | ||
cache_etags: bool = ..., | ||
serializer: Incomplete | None = ..., | ||
status_codes: Incomplete | None = ..., | ||
cache: BaseCache | None = None, | ||
cache_etags: bool = True, | ||
serializer: Incomplete | None = None, | ||
status_codes: Collection[int] | None = None, | ||
) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
from typing import Collection, Type | ||
|
||
from _typeshed import Incomplete | ||
from requests import Session | ||
|
||
from .cache import BaseCache | ||
from .controller import CacheController | ||
|
||
def CacheControl( | ||
sess: Session, | ||
cache: Incomplete | None = ..., | ||
cache_etags: bool = ..., | ||
serializer: Incomplete | None = ..., | ||
heuristic: Incomplete | None = ..., | ||
controller_class: Incomplete | None = ..., | ||
adapter_class: Incomplete | None = ..., | ||
cacheable_methods: Incomplete | None = ..., | ||
cache: BaseCache | None = None, | ||
cache_etags: bool = True, | ||
serializer: Incomplete | None = None, | ||
heuristic: Incomplete | None = None, | ||
controller_class: Type[CacheController] | None = None, | ||
adapter_class: Incomplete | None = None, | ||
cacheable_methods: Collection[str] | None = None, | ||
) -> Session: ... |