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

View File

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

View File

@@ -184,6 +184,7 @@ class WorkerCron(Worker):
def stop(self) -> None: ...
server: CommonServer | None
server_phoenix: bool
def load_server_wide_modules() -> 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 RecordDictWrapper(dict):
record: Any
def __init__(self, record) -> None: ...
def __getitem__(self, key): ...
def str2bool(value) -> 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 scan_languages() -> list[tuple[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: ...
DEFAULT_SERVER_DATE_FORMAT: str

View File

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

View File

@@ -18,8 +18,6 @@ SKIPPED_ELEMENTS: tuple[str, ...]
class UNIX_LINE_TERMINATOR(csv.excel):
lineterminator: str
def encode(s: str) -> str: ...
TRANSLATED_ELEMENTS: set[str]
TRANSLATED_ATTRS: dict[str, Any]
@@ -168,7 +166,9 @@ def trans_load_data(
def get_locales(lang: str | None = ...) -> None: ...
def resetlocale() -> str: ...
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:
python_translations: dict[tuple[str, str], dict]