Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-10-06 17:46:15 +07:00
parent 147af79105
commit 63ad4a9db3
2 changed files with 94 additions and 82 deletions

View File

@@ -48,7 +48,7 @@ def call_kw(model: BaseModel, name: str, args, kwargs): ...
class Environment(Mapping): class Environment(Mapping):
cr: Cursor = ... cr: Cursor = ...
uid: int = ... uid: int = ...
context: dict = ... context: dict[str, Any] = ...
su: bool = ... su: bool = ...
envs: None envs: None
args: tuple[Cursor, int, dict, bool] args: tuple[Cursor, int, dict, bool]

View File

@@ -1,123 +1,135 @@
from .cache import *
import pickle as pickle_ import pickle as pickle_
from collections.abc import Mapping, MutableMapping, MutableSet
from logging import Filter, LogRecord
from typing import Any, Collection, Generic, IO, AnyStr, Iterable, Iterator, NoReturn, TypeVar, Callable
import xlsxwriter import xlsxwriter
import xlwt import xlwt
from babel.core import Locale
from xlwt import Worksheet
from .cache import *
from .parse_version import parse_version as parse_version from .parse_version import parse_version as parse_version
from collections.abc import Mapping, MutableMapping, MutableSet from ..loglevels import exception_to_unicode as exception_to_unicode, get_encodings as get_encodings
from odoo.loglevels import exception_to_unicode as exception_to_unicode, get_encodings as get_encodings from ..sql_db import Cursor
from typing import Any
_logger: Any _T = TypeVar('_T')
SKIPPED_ELEMENT_TYPES: Any _T1 = TypeVar('_T1')
_KT = TypeVar('_KT')
_VT = TypeVar('_VT')
def find_in_path(name): ... SKIPPED_ELEMENT_TYPES: tuple
def _exec_pipe(prog, args, env: Any | None = ...): ... NON_BREAKING_SPACE: str
def exec_command_pipe(name, *args): ...
def find_pg_tool(name): ... def find_in_path(name: str) -> str: ...
def exec_pg_environ(): ... def _exec_pipe(prog, args, env: Mapping[str, str] | None = ...) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def exec_pg_command(name, *args) -> None: ... def exec_command_pipe(name: str, *args) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def exec_pg_command_pipe(name, *args): ... def find_pg_tool(name: str) -> str: ...
def file_path(file_path, filter_ext=...): ... def exec_pg_environ() -> dict[str, str]: ...
def file_open(name, mode: str = ..., filter_ext: Any | None = ...): ... def exec_pg_command(name: str, *args) -> None: ...
def flatten(list): ... def exec_pg_command_pipe(name: str, *args) -> tuple[IO[AnyStr] | None, IO[AnyStr] | None]: ...
def file_path(file_path: str, filter_ext: tuple[str, ...] = ...) -> str: ...
def file_open(name: str, mode: str = ..., filter_ext: tuple[str] | None = ...) -> IO: ...
def flatten(list) -> list: ...
def reverse_enumerate(l): ... def reverse_enumerate(l): ...
def partition(pred, elems): ... def partition(pred: Callable[[_T], bool], elems: Iterable[_T]) -> tuple[list[_T], list[_T]]: ...
def topological_sort(elems): ... def topological_sort(elems: dict[_T, Any]) -> list[_T]: ...
def merge_sequences(*iterables): ... def merge_sequences(*iterables: Iterable[_T]) -> list[_T]: ...
class PatchedWorkbook(xlwt.Workbook): class PatchedWorkbook(xlwt.Workbook):
def add_sheet(self, name, cell_overwrite_ok: bool = ...): ... def add_sheet(self, name: str, cell_overwrite_ok: bool = ...) -> Worksheet: ...
class PatchedXlsxWorkbook(xlsxwriter.Workbook): class PatchedXlsxWorkbook(xlsxwriter.Workbook):
def add_worksheet(self, name: Any | None = ..., **kw): ... def add_worksheet(self, name: str | None = ..., **kw) -> Worksheet: ...
def to_xml(s): ... def to_xml(s: str) -> str: ...
def get_iso_codes(lang): ... def get_iso_codes(lang: str) -> str: ...
def scan_languages(): ... def scan_languages() -> list[tuple[str, str]]: ...
def mod10r(number): ... def mod10r(number: str) -> str: ...
def str2bool(s, default: Any | None = ...): ... def str2bool(s: str, default: Any | None = ...) -> bool: ...
def human_size(sz): ... def human_size(sz) -> str: ...
def logged(f): ... def logged(f: Callable) -> Callable: ...
class profile: class profile:
fname: Any fname: str | None
def __init__(self, fname: Any | None = ...) -> None: ... def __init__(self, fname: str | None = ...) -> None: ...
def __call__(self, f): ... def __call__(self, f: Callable) -> Callable: ...
def detect_ip_addr(): ... def detect_ip_addr() -> str: ...
DEFAULT_SERVER_DATE_FORMAT: str DEFAULT_SERVER_DATE_FORMAT: str
DEFAULT_SERVER_TIME_FORMAT: str DEFAULT_SERVER_TIME_FORMAT: str
DEFAULT_SERVER_DATETIME_FORMAT: Any DEFAULT_SERVER_DATETIME_FORMAT: str
DATE_LENGTH: Any DATE_LENGTH: int
DATETIME_FORMATS_MAP: Any DATETIME_FORMATS_MAP: dict[str, str]
POSIX_TO_LDML: Any POSIX_TO_LDML: dict[str, str]
def posix_to_ldml(fmt, locale): ... def posix_to_ldml(fmt: str, locale: Locale) -> str: ...
def split_every(n, iterable, piece_maker=...) -> None: ... def split_every(n: int, iterable: Iterable[_T], piece_maker: Callable[[Iterable[_T]], _T1] = ...) -> Iterator[_T1]: ...
def get_and_group_by_field(cr, uid, obj, ids, field, context: Any | None = ...): ... def get_and_group_by_field(cr: Cursor, uid: int, obj, ids, field: str, context: dict | None = ...) -> dict: ...
def get_and_group_by_company(cr, uid, obj, ids, context: Any | None = ...): ... def get_and_group_by_company(cr: Cursor, uid: int, obj, ids, context: dict | None = ...) -> dict: ...
def resolve_attr(obj, attr): ... def resolve_attr(obj, attr: str): ...
def attrgetter(*items): ... def attrgetter(*items): ...
def discardattr(obj, key) -> None: ... def discardattr(obj, key: str) -> None: ...
def remove_accents(input_str): ... def remove_accents(input_str: str) -> str: ...
class unquote(str): class unquote(str):
def __repr__(self): ... def __repr__(self) -> str: ...
class UnquoteEvalContext(defaultdict): class UnquoteEvalContext(defaultdict):
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
def __missing__(self, key): ... def __missing__(self, key) -> unquote: ...
class mute_logger: class mute_logger(Filter):
loggers: Any loggers: tuple[str]
def __init__(self, *loggers) -> None: ... def __init__(self, *loggers: str) -> None: ...
def filter(self, record): ... def filter(self, record: LogRecord) -> int: ...
def __enter__(self) -> None: ... def __enter__(self) -> None: ...
def __exit__(self, exc_type: Any | None = ..., exc_val: Any | None = ..., exc_tb: Any | None = ...) -> None: ... def __exit__(self, exc_type: Any | None = ..., exc_val: Any | None = ..., exc_tb: Any | None = ...) -> None: ...
def __call__(self, func): ... def __call__(self, func: Callable) -> Callable: ...
_ph: Any _ph: Any
class CountingStream: class CountingStream(Generic[_T]):
stream: Any stream: Iterator[_T]
index: Any index: int
stopped: bool stopped: bool
def __init__(self, stream, start: int = ...) -> None: ... def __init__(self, stream: Iterable[_T], start: int = ...) -> None: ...
def __iter__(self): ... def __iter__(self) -> CountingStream[_T]: ...
def next(self): ... def next(self) -> _T: ...
__next__: Any __next__ = next
def stripped_sys_argv(*strip_args): ... def stripped_sys_argv(*strip_args: str) -> list[str]: ...
class ConstantMapping(Mapping): class ConstantMapping(Mapping[_KT, _VT]):
__slots__: Any __slots__ = ['_value']
_value: Any _value: _VT
def __init__(self, val) -> None: ... def __init__(self, val: _VT) -> None: ...
def __len__(self): ... def __len__(self) -> int: ...
def __iter__(self): ... def __iter__(self) -> Iterator: ...
def __getitem__(self, item): ... def __getitem__(self, item) -> _VT: ...
def dumpstacks(sig: Any | None = ..., frame: Any | None = ..., thread_idents: Any | None = ...) -> None: ... def dumpstacks(sig: Any | None = ..., frame: Any | None = ..., thread_idents: Any | None = ...) -> None: ...
def freehash(arg): ... def freehash(arg) -> int: ...
def clean_context(context): ... def clean_context(context: dict[str, Any]) -> dict[str, Any]: ...
class frozendict(dict): class frozendict(dict):
__slots__: Any __slots__ = ()
def __delitem__(self, key) -> None: ... def __delitem__(self, key) -> NoReturn: ...
def __setitem__(self, key, val) -> None: ... def __setitem__(self, key, val) -> NoReturn: ...
def clear(self) -> None: ... def clear(self) -> NoReturn: ...
def pop(self, key, default: Any | None = ...) -> None: ... def pop(self, key, default: Any | None = ...) -> NoReturn: ...
def popitem(self) -> None: ... def popitem(self) -> NoReturn: ...
def setdefault(self, key, default: Any | None = ...) -> None: ... def setdefault(self, key, default: Any | None = ...) -> NoReturn: ...
def update(self, *args, **kwargs) -> None: ... def update(self, *args, **kwargs) -> NoReturn: ...
def __hash__(self): ... def __hash__(self) -> int: ...
class Collector(dict): class Collector(dict[_KT, tuple[_T]]):
__slots__: Any __slots__ = ()
def __getitem__(self, key): ... def __getitem__(self, key: _KT) -> tuple[_T]: ...
def __setitem__(self, key, val) -> None: ... def __setitem__(self, key: _KT, val: Iterable[_T]) -> None: ...
def add(self, key, val) -> None: ... def add(self, key: _KT, val: _T) -> None: ...
def discard_keys_and_values(self, excludes: Collection): ...
class StackMap(MutableMapping): class StackMap(MutableMapping):
__slots__: Any __slots__: Any