mirror of
https://github.com/odoo-ide/odoo-stubs.git
synced 2025-05-08 16:52:26 +03:00
Update stubs
This commit is contained in:
53
odoo-stubs/tools/_vendor/sessions.pyi
Normal file
53
odoo-stubs/tools/_vendor/sessions.pyi
Normal file
@@ -0,0 +1,53 @@
|
||||
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]: ...
|
||||
Reference in New Issue
Block a user