From adcc6c8de00624a8650b3a6f715effe722755c8a Mon Sep 17 00:00:00 2001 From: Trinh Anh Ngoc Date: Sun, 16 Oct 2022 23:38:29 +0700 Subject: [PATCH] Update stubs --- odoo-stubs/tools/mail.pyi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/odoo-stubs/tools/mail.pyi b/odoo-stubs/tools/mail.pyi index 3b772bf..1385ce8 100644 --- a/odoo-stubs/tools/mail.pyi +++ b/odoo-stubs/tools/mail.pyi @@ -1,15 +1,13 @@ from email.message import Message from re import Pattern -from typing import FrozenSet, Literal +from typing import Collection, FrozenSet, Literal from lxml.etree import _Element from lxml.html import clean from markupsafe import Markup -tags_to_kill: list[str] -tags_to_remove: list[str] -allowed_tags: FrozenSet safe_attrs: FrozenSet +SANITIZE_TAGS: dict[str, Collection[str]] class _Cleaner(clean.Cleaner): _style_re: Pattern @@ -27,10 +25,13 @@ def html_sanitize(src: str, silent: bool = ..., sanitize_tags: bool = ..., sanit URL_REGEX: str TEXT_URL_REGEX: str HTML_TAG_URL_REGEX: str +HTML_TAGS_REGEX: Pattern +HTML_NEWLINES_REGEX: Pattern def validate_url(url: str) -> str: ... def is_html_empty(html_content: str) -> bool: ... def html_keep_url(text: str) -> str: ... +def html_to_inner_content(html: str) -> str: ... def html2plaintext(html: str, body_id: str | None = ..., encoding: str = ...) -> str: ... def plaintext2html(text: str, container_tag: str = ...) -> Markup: ... def append_content_to_html(html: str, content: str, plaintext: bool = ..., preserve: bool = ..., container_tag: str = ...) -> Markup: ... @@ -45,7 +46,7 @@ def generate_tracking_message_id(res_id: str) -> str: ... def email_split_tuples(text: str) -> list[str]: ... def email_split(text: str) -> list[str]: ... def email_split_and_format(text: str) -> list[str]: ... -def email_normalize(text: str) -> str | Literal[False]: ... +def email_normalize(text: str, strict: bool = ...) -> str | Literal[False]: ... def email_domain_extract(email: str) -> str | Literal[False]: ... def email_domain_normalize(domain: str) -> str | Literal[False]: ... def url_domain_extract(url: str) -> str | Literal[False]: ...