Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-10-17 09:55:23 +07:00
parent 6bdbd819f8
commit 153c98d9c4

View File

@@ -10,13 +10,13 @@ from polib import POFile
from .pycompat import _CsvWriter
from ..api import Environment
from ..fields import Field
from ..models import BaseModel
from ..sql_db import Connection, Cursor
WEB_TRANSLATION_COMMENT: str
SKIPPED_ELEMENTS: tuple[str, ...]
_LOCALE2WIN32: dict[str, str]
ENGLISH_SMALL_WORDS: set[str]
class UNIX_LINE_TERMINATOR(csv.excel):
lineterminator: str
@@ -29,7 +29,6 @@ TRANSLATED_ATTRS: dict[str, Any]
def translate_attrib_value(node: _Element) -> bool: ...
avoid_pattern: Pattern
node_pattern: Pattern
def translate_xml_node(node: _Element, callback: Callable[[str], str | None], parse: Callable[[str], _Element],
serialize: Callable[[_Element], str]) -> _Element: ...
@@ -41,8 +40,10 @@ _HTML_PARSER: HTMLParser
def parse_html(text: str) -> _Element: ...
def serialize_html(node: _Element) -> str: ...
def xml_translate(callback: Callable[[str], str | None], value: str) -> str: ...
def xml_term_converter(value: str) -> str: ...
def html_translate(callback: Callable[[str], str | None], value: str) -> str: ...
def translate(cr: Cursor, name: str, source_type: str, lang: str, source: str | None = ...) -> str: ...
def html_term_converter(value: str) -> str: ...
def get_text_content(term: str) -> str: ...
def translate_sql_constraint(cr: Cursor, key: str, lang: str) -> str: ...
class GettextAlias:
@@ -51,12 +52,13 @@ class GettextAlias:
def _get_uid(self, frame: FrameType) -> int: ...
def _get_lang(self, frame: FrameType) -> str: ...
def __call__(self, source: str, *args, **kwargs) -> str: ...
def _get_translation(self, source: str) -> str: ...
def _get_translation(self, source: str, module: str | None = ...) -> str: ...
class _lt:
__slots__ = ['_source', '_args']
__slots__ = ['_source', '_args', '_module']
_source: str
_args: tuple
_module: str
def __init__(self, source: str, *args, **kwargs) -> None: ...
def __str__(self) -> str: ...
def __eq__(self, other) -> NoReturn: ...
@@ -108,11 +110,11 @@ class TarFileWriter:
def write_rows(self, rows: Iterable) -> None: ...
def trans_export(lang: str, modules: list[str], buffer, format: str, cr: Cursor) -> None: ...
def trans_parse_rml(de: Iterable) -> list[bytes]: ...
def _push(callback: Callable[[str, int], Any], term: str, source_line: int) -> None: ...
def in_modules(object_name: str, modules: Container[str]) -> bool: ...
def _extract_translatable_qweb_terms(element: _Element, callback: Callable[[str, int], Any]) -> None: ...
def babel_extract_qweb(fileobj: IO, keywords, comment_tags, options) -> list[tuple]: ...
def extract_formula_terms(formula: str) -> Iterator[str]: ...
def extract_spreadsheet_terms(fileobj, keywords, comment_tags, options) -> Iterator[tuple[int, str, str, list]]: ...
ImdInfo = namedtuple('ExternalId', ['name', 'model', 'res_id', 'module'])
@@ -127,7 +129,7 @@ class TranslationModuleReader:
def __init__(self, cr: Cursor, modules: list[str] | None = ..., lang: str | None = ...) -> None: ...
def __iter__(self) -> Iterable[tuple]: ...
def _push_translation(self, module: str, ttype: str, name: str, res_id: str, source: str,
comments: Iterable[str] | None = ..., record_id: int | None = ...) -> None: ...
comments: Iterable[str] | None = ..., record_id: int | None = ..., value: Any | None = ...) -> None: ...
def _get_translatable_records(self, imd_records: Iterable[ImdInfo]) -> BaseModel: ...
def _export_translatable_records(self) -> None: ...
def _get_module_from_path(self, path: str) -> str: ...
@@ -136,10 +138,26 @@ class TranslationModuleReader:
extra_comments: list[str] | None = ..., extract_keywords: dict = ...) -> None: ...
def _export_translatable_resources(self) -> None: ...
def trans_load(cr: Cursor, filename: str, lang: str, verbose: bool = ..., create_empty_translation: bool = ...,
overwrite: bool = ...) -> None: ...
def trans_load_data(cr: Cursor, fileobj: IO, fileformat: str, lang: str, verbose: bool = ...,
create_empty_translation: bool = ..., overwrite: bool = ...) -> None: ...
def trans_load(cr: Cursor, filename: str, lang: str, verbose: bool = ..., overwrite: bool = ...) -> None: ...
def trans_load_data(cr: Cursor, fileobj: IO, fileformat: str, lang: str, verbose: bool = ..., overwrite: bool = ...) -> None: ...
def _trans_load_data(cr: Cursor, reader, lang: str, overwrite: bool = ..., force_overwrite: bool = ...,
xml_ids: Container[str] | None = ...) -> None: ...
def get_locales(lang: str | None = ...) -> None: ...
def resetlocale() -> str: ...
def load_language(cr: Cursor, lang: str) -> None: ...
class CodeTranslations:
python_translations: dict[tuple[str, str], dict]
web_translations: dict[tuple[str, str], dict]
def __init__(self) -> None: ...
def _get_po_paths(self, mod: str, lang: str) -> list[str]: ...
def _trans_load_code_python(self, fileobj: IO, fileformat: str, lang: str) -> dict: ...
def _trans_load_code_webclient(self, fileobj: IO, fileformat: str, lang: str) -> dict: ...
def _load_python_translations(self, module_name: str, lang: str) -> None: ...
def _load_web_translations(self, module_name: str, lang: str) -> None: ...
def get_python_translations(self, module_name: str, lang: str) -> dict: ...
def get_web_translations(self, module_name: str, lang: str) -> dict: ...
code_translations: CodeTranslations
def _get_translation_upgrade_queries(cr: Cursor, field: Field) -> tuple[list, list]: ...