Update stubs

This commit is contained in:
Trinh Anh Ngoc
2023-02-26 11:20:14 +07:00
parent d63bfdc07a
commit e3384a6306
5 changed files with 15 additions and 5 deletions

View File

@@ -225,14 +225,14 @@ class Dispatcher(ABC):
def dispatch(self, endpoint, args): ...
def post_dispatch(self, response: werkzeug.Response) -> None: ...
@abstractmethod
def handle_error(self, exc: Exception): ...
def handle_error(self, exc: Exception) -> Callable: ...
class HttpDispatcher(Dispatcher):
routing_type: str
@classmethod
def is_compatible_with(cls, request: Request) -> Literal[True]: ...
def dispatch(self, endpoint, args): ...
def handle_error(self, exc: Exception): ...
def handle_error(self, exc: Exception) -> Callable: ...
class JsonRPCDispatcher(Dispatcher):
routing_type: str
@@ -241,7 +241,7 @@ class JsonRPCDispatcher(Dispatcher):
@classmethod
def is_compatible_with(cls, request: Request) -> bool: ...
def dispatch(self, endpoint, args): ...
def handle_error(self, exc: Exception) -> Response: ...
def handle_error(self, exc: Exception) -> Callable: ...
def _response(self, result: Any | None = ..., error: Any | None = ...) -> Response: ...
class Application:

View File

@@ -2,7 +2,7 @@ import threading
from collections import defaultdict, deque
from collections.abc import Mapping
from threading import RLock
from typing import Any, Callable, ClassVar, Iterable, Iterator
from typing import Any, Callable, ClassVar, Collection, Iterable, Iterator
from .graph import Node
from ..models import BaseModel
@@ -22,6 +22,7 @@ class Registry(Mapping[str, type[BaseModel]]):
models: dict[str, type[BaseModel]]
_sql_constraints: set
_init: bool
_database_translated_fields: Collection[str]
_assertion_report: OdooTestResult
_fields_by_model: Any
_ordinary_tables: set[str] | None

View File

@@ -1,10 +1,16 @@
import logging.handlers
import warnings
from logging import Logger, LogRecord
from typing import TextIO
from typing import IO, TextIO
def log(logger: Logger, level: int, prefix: str, msg, depth: int | None = ...) -> None: ...
class WatchedFileHandler(logging.handlers.WatchedFileHandler):
errors: None
_builtin_open: None
def __init__(self, filename: str) -> None: ...
def _open(self) -> IO: ...
class PostgreSQLHandler(logging.Handler):
def emit(self, record: LogRecord) -> None: ...

View File

@@ -34,6 +34,8 @@ class RequestHandler(werkzeug.serving.WSGIRequestHandler):
def setup(self) -> None: ...
protocol_version: str
def make_environ(self) -> dict[str, Any]: ...
close_connection: bool
def send_header(self, keyword, value) -> None: ...
class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer):
max_http_threads: Any

View File

@@ -18,6 +18,7 @@ PdfFileWriter = BrandedFileWriter
def merge_pdf(pdf_data: Iterable[bytes]) -> bytes: ...
def rotate_pdf(pdf: bytes) -> bytes: ...
def to_pdf_stream(attachment: 'odoo.model.ir_attachment') -> BytesIO: ...
def add_banner(pdf_stream: str | BinaryIO, text: str | None = ..., logo: bool = ..., thickness: float = ...) -> BytesIO: ...
class OdooPdfFileReader(PdfFileReader):