Update stubs

This commit is contained in:
Trinh Anh Ngoc
2024-07-29 16:01:37 +07:00
parent ae052007d0
commit 4cccc17344
7 changed files with 11 additions and 22 deletions

View File

@@ -205,6 +205,7 @@ class Monetary(Field[float]):
class _String(Field[str]): class _String(Field[str]):
translate: Callable | bool translate: Callable | bool
size: int | None
def __init__(self, string: str = ..., **kwargs) -> None: ... def __init__(self, string: str = ..., **kwargs) -> None: ...
def get_trans_terms(self, value) -> list: ... def get_trans_terms(self, value) -> list: ...
def get_text_content(self, term): ... def get_text_content(self, term): ...
@@ -222,7 +223,6 @@ class _String(Field[str]):
class Char(_String): class Char(_String):
type: str type: str
size: int | None
trim: bool trim: bool
@property @property
def column_type(self) -> tuple[str, str]: ... def column_type(self) -> tuple[str, str]: ...
@@ -230,15 +230,11 @@ class Char(_String):
def convert_to_column( def convert_to_column(
self, value, record: BaseModel, values: Any | None = ..., validate: bool = ... self, value, record: BaseModel, values: Any | None = ..., validate: bool = ...
) -> str | None: ... ) -> str | None: ...
def convert_to_cache(
self, value, record: BaseModel, validate: bool = ...
) -> str | None: ...
class Text(_String): class Text(_String):
type: str type: str
@property @property
def column_type(self) -> tuple[str, str]: ... def column_type(self) -> tuple[str, str]: ...
def convert_to_cache(self, value, record, validate: bool = ...) -> str | None: ...
class Html(_String): class Html(_String):
type: str type: str

View File

@@ -8,8 +8,5 @@ LOG_ERROR: str
LOG_CRITICAL: str LOG_CRITICAL: str
def get_encodings(hint_encoding: str = ...) -> Generator[str, None, None]: ... def get_encodings(hint_encoding: str = ...) -> Generator[str, None, None]: ...
text_type: type[str]
def ustr(value, hint_encoding: str = ..., errors: str = ...) -> str: ... def ustr(value, hint_encoding: str = ..., errors: str = ...) -> str: ...
def exception_to_unicode(e: BaseException) -> str: ... def exception_to_unicode(e: BaseException) -> str: ...

View File

@@ -184,6 +184,7 @@ class WorkerCron(Worker):
def stop(self) -> None: ... def stop(self) -> None: ...
server: CommonServer | None server: CommonServer | None
server_phoenix: bool
def load_server_wide_modules() -> None: ... def load_server_wide_modules() -> None: ...
def load_test_file_py(registry: Registry, test_file: str) -> None: ... def load_test_file_py(registry: Registry, test_file: str) -> None: ...

View File

@@ -9,11 +9,6 @@ safe_eval: Callable
class ParseError(Exception): ... class ParseError(Exception): ...
class RecordDictWrapper(dict):
record: Any
def __init__(self, record) -> None: ...
def __getitem__(self, key): ...
def str2bool(value) -> bool: ... def str2bool(value) -> bool: ...
def nodeattr2bool(node: _Element, attr, default: bool = ...) -> bool: ... def nodeattr2bool(node: _Element, attr, default: bool = ...) -> bool: ...

View File

@@ -70,7 +70,7 @@ class PatchedXlsxWorkbook(xlsxwriter.Workbook):
def get_iso_codes(lang: str) -> str: ... def get_iso_codes(lang: str) -> str: ...
def scan_languages() -> list[tuple[str, str]]: ... def scan_languages() -> list[tuple[str, str]]: ...
def mod10r(number: str) -> str: ... def mod10r(number: str) -> str: ...
def str2bool(s: str, default: Any | None = ...) -> bool: ... def str2bool(s: str, default: bool | None = ...) -> bool: ...
def human_size(sz) -> str: ... def human_size(sz) -> str: ...
DEFAULT_SERVER_DATE_FORMAT: str DEFAULT_SERVER_DATE_FORMAT: str

View File

@@ -1,7 +1,7 @@
import enum import enum
from collections import defaultdict from collections import defaultdict
from re import Pattern from re import Pattern
from typing import Iterable, Iterator, Literal from typing import Iterable, Literal
from ..fields import Field from ..fields import Field
from ..models import BaseModel from ..models import BaseModel
@@ -10,11 +10,11 @@ from ..sql_db import Cursor
IDENT_RE: Pattern IDENT_RE: Pattern
class SQL: class SQL:
def __new__( def __init__(
cls, code: str | SQL = ..., *args, to_flush: Field | None = ..., **kwargs self, code: str | SQL = ..., *args, to_flush: Field | None = ..., **kwargs
) -> SQL: ... ) -> None: ...
@property @property
def to_flush(self) -> Iterator[Field]: ... def to_flush(self) -> Iterable[Field]: ...
@property @property
def code(self) -> str: ... def code(self) -> str: ...
@property @property

View File

@@ -18,8 +18,6 @@ SKIPPED_ELEMENTS: tuple[str, ...]
class UNIX_LINE_TERMINATOR(csv.excel): class UNIX_LINE_TERMINATOR(csv.excel):
lineterminator: str lineterminator: str
def encode(s: str) -> str: ...
TRANSLATED_ELEMENTS: set[str] TRANSLATED_ELEMENTS: set[str]
TRANSLATED_ATTRS: dict[str, Any] TRANSLATED_ATTRS: dict[str, Any]
@@ -168,7 +166,9 @@ def trans_load_data(
def get_locales(lang: str | None = ...) -> None: ... def get_locales(lang: str | None = ...) -> None: ...
def resetlocale() -> str: ... def resetlocale() -> str: ...
def load_language(cr: Cursor, lang: str) -> None: ... def load_language(cr: Cursor, lang: str) -> None: ...
def get_po_paths(module_name: str, lang: str) -> Iterator[str]: ... def get_po_paths(
module_name: str, lang: str, env: Environment | None = ...
) -> Iterator[str]: ...
class CodeTranslations: class CodeTranslations:
python_translations: dict[tuple[str, str], dict] python_translations: dict[tuple[str, str], dict]