Update stubs

This commit is contained in:
Trinh Anh Ngoc
2024-11-18 16:27:39 +07:00
parent 3f72b13dca
commit 5a5151fdf0
4 changed files with 10 additions and 4 deletions

View File

@@ -248,6 +248,8 @@ class Html(_String):
sanitize_attributes: bool sanitize_attributes: bool
sanitize_style: bool sanitize_style: bool
sanitize_form: bool sanitize_form: bool
sanitize_conditional_comments: bool
sanitize_output_method: str
strip_style: bool strip_style: bool
strip_classes: bool strip_classes: bool
def convert_to_column( def convert_to_column(

View File

@@ -10,7 +10,9 @@ SANITIZE_TAGS: dict[str, Collection[str]]
def tag_quote(el: _Element) -> None: ... def tag_quote(el: _Element) -> None: ...
def html_normalize( def html_normalize(
src: str, filter_callback: Callable[[_Element], _Element] | None = ... src: str,
filter_callback: Callable[[_Element], _Element] | None = ...,
output_method: str = ...,
) -> str: ... ) -> str: ...
def html_sanitize( def html_sanitize(
src: str, src: str,
@@ -19,8 +21,10 @@ def html_sanitize(
sanitize_attributes: bool = ..., sanitize_attributes: bool = ...,
sanitize_style: bool = ..., sanitize_style: bool = ...,
sanitize_form: bool = ..., sanitize_form: bool = ...,
sanitize_conditional_comments: bool = ...,
strip_style: bool = ..., strip_style: bool = ...,
strip_classes: bool = ..., strip_classes: bool = ...,
output_method: str = ...,
) -> Markup: ... ) -> Markup: ...
URL_SKIP_PROTOCOL_REGEX: str URL_SKIP_PROTOCOL_REGEX: str
@@ -34,6 +38,7 @@ def validate_url(url: str) -> str: ...
def is_html_empty(html_content: str) -> bool: ... def is_html_empty(html_content: str) -> bool: ...
def html_keep_url(text: str) -> str: ... def html_keep_url(text: str) -> str: ...
def html_to_inner_content(html: str) -> str: ... def html_to_inner_content(html: str) -> str: ...
def create_link(url: str, label: str) -> str: ...
def html2plaintext( def html2plaintext(
html: str, body_id: str | None = ..., encoding: str = ... html: str, body_id: str | None = ..., encoding: str = ...
) -> str: ... ) -> str: ...

View File

@@ -178,6 +178,7 @@ class OrderedSet(MutableSet[_T], Generic[_T]):
def discard(self, elem) -> None: ... def discard(self, elem) -> None: ...
def update(self, elems: Iterable) -> None: ... def update(self, elems: Iterable) -> None: ...
def difference_update(self, elems: Iterable) -> None: ... def difference_update(self, elems: Iterable) -> None: ...
def intersection(self, *others): ...
class LastOrderedSet(OrderedSet[_T], Generic[_T]): class LastOrderedSet(OrderedSet[_T], Generic[_T]):
def add(self, elem) -> None: ... def add(self, elem) -> None: ...

View File

@@ -4,8 +4,6 @@ from typing import Any, BinaryIO, Iterable
from odoo.addons.base.models.ir_attachment import IrAttachment from odoo.addons.base.models.ir_attachment import IrAttachment
from PyPDF2 import PdfFileReader, PdfFileWriter from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.generic import ArrayObject as ArrayObject
from PyPDF2.utils import b_ as b_
DEFAULT_PDF_DATETIME_FORMAT: str DEFAULT_PDF_DATETIME_FORMAT: str
REGEX_SUBTYPE_UNFORMATED: Pattern REGEX_SUBTYPE_UNFORMATED: Pattern
@@ -34,7 +32,7 @@ class OdooPdfFileReader(PdfFileReader):
class OdooPdfFileWriter(PdfFileWriter): class OdooPdfFileWriter(PdfFileWriter):
is_pdfa: bool is_pdfa: bool
def __init__(self, *args, **kwargs) -> None: ... def __init__(self, *args, **kwargs) -> None: ...
def addAttachment(self, fname: str, fdata, subtype: str | None = ...) -> None: ... def addAttachment(self, name: str, data, subtype: str | None = ...) -> None: ...
def embed_odoo_attachment( def embed_odoo_attachment(
self, attachment: IrAttachment, subtype: str | None = ... self, attachment: IrAttachment, subtype: str | None = ...
) -> None: ... ) -> None: ...