mirror of
https://github.com/odoo-ide/odoo-stubs.git
synced 2025-05-08 16:52:26 +03:00
62 lines
2.0 KiB
Python
62 lines
2.0 KiB
Python
from re import Pattern
|
|
from typing import Any, Generic, TypeVar
|
|
|
|
from werkzeug.datastructures import CallbackDict
|
|
|
|
_ModificationTrackingDictT = TypeVar(
|
|
"_ModificationTrackingDictT", bound=ModificationTrackingDict
|
|
)
|
|
_SessionT = TypeVar("_SessionT", bound=Session)
|
|
|
|
_sha1_re: Pattern
|
|
|
|
def generate_key(salt: Any = ...) -> str: ...
|
|
|
|
class ModificationTrackingDict(CallbackDict):
|
|
__slots__ = ("modified",)
|
|
modified: bool
|
|
def __init__(self, *args, **kwargs): ...
|
|
def copy(self: _ModificationTrackingDictT) -> _ModificationTrackingDictT: ...
|
|
def __copy__(self: _ModificationTrackingDictT) -> _ModificationTrackingDictT: ...
|
|
|
|
class Session(ModificationTrackingDict):
|
|
__slots__ = ("modified", "sid", "new")
|
|
sid: str
|
|
new: bool
|
|
def __init__(self, data, sid, new: bool = ...): ...
|
|
def __repr__(self) -> str: ...
|
|
@property
|
|
def should_save(self) -> bool: ...
|
|
|
|
class SessionStore(Generic[_SessionT]):
|
|
session_class: type[_SessionT]
|
|
def __init__(self, session_class: type[_SessionT] | None = ...): ...
|
|
def is_valid_key(self, key) -> bool: ...
|
|
def generate_key(self, salt: Any = ...) -> str: ...
|
|
def new(self) -> _SessionT: ...
|
|
def save(self, session: _SessionT) -> None: ...
|
|
def save_if_modified(self, session: _SessionT) -> None: ...
|
|
def delete(self, session: _SessionT) -> None: ...
|
|
def get(self, sid: str) -> _SessionT: ...
|
|
|
|
_fs_transaction_suffix: str
|
|
|
|
class FilesystemSessionStore(SessionStore[_SessionT]):
|
|
path: str | None
|
|
filename_template: str
|
|
renew_missing: bool
|
|
mode: int
|
|
def __init__(
|
|
self,
|
|
path: str | None = ...,
|
|
filename_template: str = ...,
|
|
session_class: type[_SessionT] | None = ...,
|
|
renew_missing: bool = ...,
|
|
mode: int = ...,
|
|
) -> None: ...
|
|
def get_session_filename(self, sid: str) -> str: ...
|
|
def save(self, session: _SessionT) -> None: ...
|
|
def delete(self, session: _SessionT) -> None: ...
|
|
def get(self, sid: str) -> _SessionT: ...
|
|
def list(self) -> list[str]: ...
|