Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-10-14 15:06:50 +07:00
parent 8d1cfe9db1
commit 9fcbd64ba6
5 changed files with 86 additions and 69 deletions

View File

@@ -139,6 +139,7 @@ class OpenERPSession(sessions.Session):
def __getattr__(self, attr): ...
def __setattr__(self, k, v): ...
pre_uid: int
uid: int
db: str
login: str | None
def authenticate(self, db: str, login: str | None = ..., password: str | None = ...) -> int: ...

View File

@@ -1,5 +1,5 @@
import threading
from collections import deque
from collections import defaultdict, deque
from collections.abc import Mapping
from threading import RLock
from typing import Any, Callable, ClassVar, Iterable, Iterator
@@ -24,7 +24,7 @@ class Registry(Mapping[str, type[BaseModel]]):
_init: bool
_assertion_report: OdooTestResult
_fields_by_model: Any
_ordinary_tables: Any
_ordinary_tables: set[str] | None
_constraint_queue: deque
__cache: LRU
_init_modules: set[str]
@@ -39,8 +39,8 @@ class Registry(Mapping[str, type[BaseModel]]):
field_depends: Collector
field_depends_context: Collector
field_inverses: Collector
registry_sequence: Any
cache_sequence: Any
registry_sequence: int | None
cache_sequence: int | None
_invalidation_flags: threading.local
has_unaccent: bool
has_trigram: bool
@@ -57,7 +57,7 @@ class Registry(Mapping[str, type[BaseModel]]):
def __delitem__(self, model_name: str) -> None: ...
def descendants(self, model_names: Iterable[str], *kinds) -> set[str]: ...
def load(self, cr: Cursor, module: Node) -> set[str]: ...
_m2m: Any
_m2m: defaultdict[Any, list]
def setup_models(self, cr: Cursor) -> None: ...
@property
def field_computed(self) -> dict[Field, list[Field]]: ...

View File

@@ -1,3 +1,8 @@
def check(db, uid, passwd): ...
def compute_session_token(session, env): ...
def check_session(session, env): ...
from typing import Literal
from ..api import Environment
from ..http import OpenERPSession
def check(db: str, uid: int, passwd: str) -> None: ...
def compute_session_token(session: OpenERPSession, env: Environment) -> str | Literal[False]: ...
def check_session(session: OpenERPSession, env: Environment) -> bool: ...

View File

@@ -1,15 +1,27 @@
import werkzeug.serving
from ..tests import runner as runner
from socket import socket as socket_
from threading import Semaphore, Thread
from gevent.pywsgi import WSGIServer
from itertools import chain as chain
from typing import Any
from typing import Any, Callable, Iterable, Literal, TypeVar
import werkzeug.serving
from inotify.adapters import InotifyTrees
from psutil import Process
from watchdog.observers import Observer
from ..modules.registry import Registry
from ..sql_db import Cursor
from ..tests import runner as runner
_WorkerT = TypeVar('_WorkerT', bound=Worker)
INOTIFY_LISTEN_EVENTS: Any
_logger: Any
SLEEP_INTERVAL: int
def memory_info(process): ...
def memory_info(process: Process): ...
def set_limit_memory_hard() -> None: ...
def empty_pipe(fd) -> None: ...
def empty_pipe(fd: int) -> None: ...
class LoggingBaseWSGIServerMixIn:
def handle_error(self, request, client_address) -> None: ...
@@ -19,16 +31,15 @@ class BaseWSGIServerNoBind(LoggingBaseWSGIServerMixIn, werkzeug.serving.BaseWSGI
def server_activate(self) -> None: ...
class RequestHandler(werkzeug.serving.WSGIRequestHandler):
timeout: int
def setup(self) -> None: ...
class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer):
max_http_threads: Any
http_threads_sem: Any
http_threads_sem: Semaphore
daemon_threads: bool
def __init__(self, host, port, app) -> None: ...
def __init__(self, host: str, port: str, app) -> None: ...
reload_socket: bool
socket: Any
socket: socket_
def server_bind(self) -> None: ...
def server_activate(self) -> None: ...
def process_request(self, request, client_address) -> None: ...
@@ -36,10 +47,10 @@ class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.
def shutdown_request(self, request) -> None: ...
class FSWatcherBase:
def handle_file(self, path): ...
def handle_file(self, path: str) -> Literal[True]: ...
class FSWatcherWatchdog(FSWatcherBase):
observer: Any
observer: Observer
def __init__(self) -> None: ...
def dispatch(self, event) -> None: ...
def start(self) -> None: ...
@@ -47,10 +58,10 @@ class FSWatcherWatchdog(FSWatcherBase):
class FSWatcherInotify(FSWatcherBase):
started: bool
watcher: Any
watcher: InotifyTrees
def __init__(self) -> None: ...
def run(self) -> None: ...
thread: Any
thread: Thread
def start(self) -> None: ...
def stop(self) -> None: ...
@@ -84,63 +95,63 @@ class ThreadedServer(CommonServer):
def reload(self) -> None: ...
class GeventServer(CommonServer):
port: Any
httpd: Any
port: int
httpd: WSGIServer | None
def __init__(self, app) -> None: ...
def process_limits(self) -> None: ...
ppid: Any
ppid: int
def watchdog(self, beat: int = ...) -> None: ...
client_address: Any
def start(self): ...
def stop(self) -> None: ...
def run(self, preload, stop) -> None: ...
def run(self, preload, stop: bool) -> None: ...
class PreforkServer(CommonServer):
population: Any
timeout: Any
limit_request: Any
cron_timeout: Any
population: int
timeout: int
limit_request: int
cron_timeout: int
beat: int
socket: Any
workers_http: Any
workers_cron: Any
workers: Any
socket: socket_ | None
workers_http: dict[int, WorkerHTTP]
workers_cron: dict[int, WorkerCron]
workers: dict[int, Worker]
generation: int
queue: Any
long_polling_pid: Any
queue: list
long_polling_pid: int | None
def __init__(self, app) -> None: ...
def pipe_new(self): ...
def pipe_ping(self, pipe) -> None: ...
def signal_handler(self, sig, frame) -> None: ...
def worker_spawn(self, klass, workers_registry): ...
def pipe_new(self) -> tuple[int, int]: ...
def pipe_ping(self, pipe: tuple[int, int]) -> None: ...
def signal_handler(self, sig: int, frame) -> None: ...
def worker_spawn(self, klass: Callable[..., _WorkerT], workers_registry: dict[int, _WorkerT]) -> _WorkerT | None: ...
def long_polling_spawn(self) -> None: ...
def worker_pop(self, pid) -> None: ...
def worker_kill(self, pid, sig) -> None: ...
def worker_pop(self, pid: int) -> None: ...
def worker_kill(self, pid: int, sig: int) -> None: ...
def process_signals(self) -> None: ...
def process_zombie(self) -> None: ...
def process_timeout(self) -> None: ...
def process_spawn(self) -> None: ...
def sleep(self) -> None: ...
pipe: Any
pipe: tuple[int, int]
def start(self) -> None: ...
def stop(self, graceful: bool = ...) -> None: ...
def run(self, preload, stop): ...
def run(self, preload, stop: bool): ...
class Worker:
multi: Any
watchdog_time: Any
watchdog_pipe: Any
eintr_pipe: Any
multi: PreforkServer
watchdog_time: float
watchdog_pipe: tuple[int, int]
eintr_pipe: tuple[int, int]
watchdog_timeout: Any
ppid: Any
pid: Any
ppid: int
pid: int | None
alive: bool
request_max: Any
request_count: int
def __init__(self, multi) -> None: ...
def __init__(self, multi: PreforkServer) -> None: ...
def setproctitle(self, title: str = ...) -> None: ...
def close(self) -> None: ...
def signal_handler(self, sig, frame) -> None: ...
def signal_handler(self, sig: int, frame) -> None: ...
def signal_time_expired_handler(self, n, stack) -> None: ...
def sleep(self) -> None: ...
def check_limits(self) -> None: ...
@@ -151,29 +162,29 @@ class Worker:
def _runloop(self) -> None: ...
class WorkerHTTP(Worker):
sock_timeout: Any
def __init__(self, multi) -> None: ...
def process_request(self, client, addr) -> None: ...
sock_timeout: float
def __init__(self, multi: PreforkServer) -> None: ...
def process_request(self, client: socket_, addr) -> None: ...
def process_work(self) -> None: ...
server: Any
server: BaseWSGIServerNoBind
def start(self) -> None: ...
class WorkerCron(Worker):
db_index: int
watchdog_timeout: Any
def __init__(self, multi) -> None: ...
watchdog_timeout: int
def __init__(self, multi: PreforkServer) -> None: ...
def sleep(self) -> None: ...
def _db_list(self): ...
def process_work(self) -> None: ...
dbcursor: Any
dbcursor: Cursor
def start(self) -> None: ...
def stop(self) -> None: ...
server: Any
server: CommonServer | None
def load_server_wide_modules() -> None: ...
def _reexec(updated_modules: Any | None = ...) -> None: ...
def load_test_file_py(registry, test_file) -> None: ...
def preload_registries(dbnames): ...
def start(preload: Any | None = ..., stop: bool = ...): ...
def _reexec(updated_modules: Iterable[str] | None = ...) -> None: ...
def load_test_file_py(registry: Registry, test_file: str) -> None: ...
def preload_registries(dbnames: list[str] | None): ...
def start(preload: list[str] | None = ..., stop: bool = ...): ...
def restart() -> None: ...

View File

@@ -1,16 +1,16 @@
from typing import Any
from werkzeug.middleware.proxy_fix import ProxyFix as ProxyFix_
from typing import Callable
_logger: Any
RPC_FAULT_CODE_CLIENT_ERROR: int
RPC_FAULT_CODE_APPLICATION_ERROR: int
RPC_FAULT_CODE_WARNING: int
RPC_FAULT_CODE_ACCESS_DENIED: int
RPC_FAULT_CODE_ACCESS_ERROR: int
def xmlrpc_handle_exception_int(e): ...
def xmlrpc_handle_exception_string(e): ...
def xmlrpc_handle_exception_int(e: Exception) -> str: ...
def xmlrpc_handle_exception_string(e: Exception) -> str: ...
def application_unproxied(environ, start_response): ...
ProxyFix: Any
ProxyFix: Callable[..., ProxyFix_]
def application(environ, start_response): ...