Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-11-19 22:17:03 +07:00
parent 56a5f20dba
commit 75241bec43
2 changed files with 71 additions and 58 deletions

View File

@@ -2,7 +2,7 @@ from typing import Any, Iterable
from .graph import Graph, Node from .graph import Graph, Node
from .registry import Registry from .registry import Registry
from ..sql_db import Cursor from ..sql_db import Cursor, Connection
from ..tools.assertion_report import assertion_report from ..tools.assertion_report import assertion_report
def load_data(cr: Cursor, idref: dict, mode: str, kind: str, package: Node, report: assertion_report) -> bool: ... def load_data(cr: Cursor, idref: dict, mode: str, kind: str, package: Node, report: assertion_report) -> bool: ...
@@ -13,5 +13,5 @@ def load_module_graph(cr: Cursor, graph: Graph, status: Any | None = ..., perfor
def _check_module_names(cr: Cursor, module_names: Iterable[str]) -> None: ... def _check_module_names(cr: Cursor, module_names: Iterable[str]) -> None: ...
def load_marked_modules(cr: Cursor, graph: Graph, states: list[str], force: list[str], progressdict, report: assertion_report, def load_marked_modules(cr: Cursor, graph: Graph, states: list[str], force: list[str], progressdict, report: assertion_report,
loaded_modules: list[str], perform_checks: Any, models_to_check: set[str] | None = ...) -> list[str]: ... loaded_modules: list[str], perform_checks: Any, models_to_check: set[str] | None = ...) -> list[str]: ...
def load_modules(db: Registry, force_demo: bool = ..., status: Any | None = ..., update_module: Any = ...) -> Registry | None: ... def load_modules(db: Connection, force_demo: bool = ..., status: Any | None = ..., update_module: Any = ...) -> Registry | None: ...
def reset_modules_state(db_name: str) -> None: ... def reset_modules_state(db_name: str) -> None: ...

View File

@@ -1,71 +1,84 @@
from collections import Mapping import threading
from typing import Any, Optional from collections import defaultdict, deque
from collections.abc import Mapping
from threading import RLock
from typing import Any, Callable, ClassVar, Iterable, Iterator
from weakref import WeakValueDictionary
from ..sql_db import Cursor from .graph import Node
from ..models import BaseModel
from ..sql_db import Connection, Cursor
from ..tools.assertion_report import assertion_report
from ..tools.lru import LRU
_logger: Any class Registry(Mapping[str, type[BaseModel]]):
_schema: Any _lock: RLock
_saved_lock: RLock | None
class Registry(Mapping): model_cache: WeakValueDictionary
_lock: Any = ... registries: ClassVar[LRU]
_saved_lock: Any = ... def __new__(cls, db_name: str) -> Registry: ...
model_cache: Any = ...
def registries(cls): ...
def __new__(cls, db_name: Any): ...
@classmethod @classmethod
def new(cls, db_name: Any, force_demo: bool = ..., status: Optional[Any] = ..., update_module: bool = ...): ... def new(cls, db_name: str, force_demo: bool = ..., status: Any | None = ..., update_module: bool = ...) -> Registry: ...
models: Any = ... models: dict[str, type[BaseModel]]
_sql_constraints: Any = ... _sql_constraints: set
_init: bool = ... _init: bool
_assertion_report: Any = ... _assertion_report: assertion_report
_fields_by_model: Any = ... _fields_by_model: Any
_post_init_queue: Any = ... _post_init_queue: deque
_constraint_queue: Any = ... _constraint_queue: deque
_init_modules: Any = ... _init_modules: set[str]
updated_modules: Any = ... updated_modules: list[str]
loaded_xmlids: Any = ... loaded_xmlids: set
db_name: Any = ... db_name: str
_db: Any = ... _db: Connection
test_cr: Any = ... test_cr: Cursor | None
test_lock: Any = ... test_lock: RLock | None
loaded: bool = ... loaded: bool
ready: bool = ... ready: bool
registry_sequence: Any = ... registry_sequence: int | None
cache_sequence: Any = ... cache_sequence: int | None
registry_invalidated: bool = ... _invalidation_flags: threading.local
cache_invalidated: bool = ... has_unaccent: bool
has_unaccent: Any = ... populated_models: dict[str, list[int]]
def init(self, db_name: Any) -> None: ... def init(self, db_name: str) -> None: ...
@classmethod @classmethod
def delete(cls, db_name: Any) -> None: ... def delete(cls, db_name: str) -> None: ...
@classmethod @classmethod
def delete_all(cls) -> None: ... def delete_all(cls) -> None: ...
def __len__(self): ... def __len__(self) -> int: ...
def __iter__(self) -> Any: ... def __iter__(self) -> Iterator[str]: ...
def __getitem__(self, model_name: Any): ... def __getitem__(self, model_name: str) -> type[BaseModel]: ...
def __call__(self, model_name: Any): ... def __call__(self, model_name: str) -> type[BaseModel]: ...
def __setitem__(self, model_name: Any, model: Any) -> None: ... def __setitem__(self, model_name: str, model: type[BaseModel]) -> None: ...
def descendants(self, model_names: Any, *kinds: Any): ... def descendants(self, model_names: Iterable[str], *kinds) -> set[str]: ...
def load(self, cr: Any, module: Any): ... def load(self, cr: Cursor, module: Node) -> set[str]: ...
_m2m: Any = ... _m2m: defaultdict[Any, list]
field_triggers: Any = ... def setup_models(self, cr: Cursor) -> None: ...
def setup_models(self, cr: Any): ... def post_init(self, func: Callable, *args, **kwargs) -> None: ...
def post_init(self, func: Any, *args: Any, **kwargs: Any) -> None: ... def post_constraint(self, func: Callable, *args, **kwargs) -> None: ...
def post_constraint(self, func: Any, *args: Any, **kwargs: Any) -> None: ...
def finalize_constraints(self) -> None: ... def finalize_constraints(self) -> None: ...
_is_install: Any = ... _is_install: bool
def init_models(self, cr: Any, model_names: Any, context: Any, install: bool = ...) -> None: ... def init_models(self, cr: Cursor, model_names: Iterable[str], context: dict, install: bool = ...) -> None: ...
def check_tables_exist(self, cr: Any) -> None: ... def check_tables_exist(self, cr: Cursor) -> None: ...
def cache(self): ... @property
def cache(self) -> LRU: ...
def _clear_cache(self) -> None: ... def _clear_cache(self) -> None: ...
def clear_caches(self) -> None: ... def clear_caches(self) -> None: ...
@property
def registry_invalidated(self) -> bool: ...
@registry_invalidated.setter
def registry_invalidated(self, value: bool) -> None: ...
@property
def cache_invalidated(self) -> bool: ...
@cache_invalidated.setter
def cache_invalidated(self, value: bool) -> None: ...
def setup_signaling(self) -> None: ... def setup_signaling(self) -> None: ...
def check_signaling(self): ... def check_signaling(self) -> Registry: ...
def signal_changes(self) -> None: ... def signal_changes(self) -> None: ...
def reset_changes(self) -> None: ... def reset_changes(self) -> None: ...
def manage_changes(self) -> None: ... def manage_changes(self) -> None: ...
def in_test_mode(self): ... def in_test_mode(self) -> bool: ...
def enter_test_mode(self, cr: Any) -> None: ... def enter_test_mode(self, cr: Cursor) -> None: ...
def leave_test_mode(self) -> None: ... def leave_test_mode(self) -> None: ...
def cursor(self) -> Cursor: ... def cursor(self) -> Cursor: ...
@@ -73,4 +86,4 @@ class DummyRLock:
def acquire(self) -> None: ... def acquire(self) -> None: ...
def release(self) -> None: ... def release(self) -> None: ...
def __enter__(self) -> None: ... def __enter__(self) -> None: ...
def __exit__(self, type: Any, value: Any, traceback: Any) -> None: ... def __exit__(self, type, value, traceback) -> None: ...