mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
from collections.abc import Callable
|
|
from email._policybase import Compat32 as Compat32, Policy as Policy, compat32 as compat32
|
|
from email.contentmanager import ContentManager
|
|
from email.message import Message
|
|
from typing import Any
|
|
|
|
__all__ = ["Compat32", "compat32", "Policy", "EmailPolicy", "default", "strict", "SMTP", "HTTP"]
|
|
|
|
class EmailPolicy(Policy):
|
|
utf8: bool
|
|
refold_source: str
|
|
header_factory: Callable[[str, Any], Any]
|
|
content_manager: ContentManager
|
|
def __init__(
|
|
self,
|
|
*,
|
|
max_line_length: int | None = ...,
|
|
linesep: str = ...,
|
|
cte_type: str = ...,
|
|
raise_on_defect: bool = ...,
|
|
mangle_from_: bool = ...,
|
|
message_factory: Callable[[Policy], Message] | None = ...,
|
|
utf8: bool = ...,
|
|
refold_source: str = ...,
|
|
header_factory: Callable[[str, str], str] = ...,
|
|
content_manager: ContentManager = ...,
|
|
) -> None: ...
|
|
def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ...
|
|
def header_store_parse(self, name: str, value: Any) -> tuple[str, Any]: ...
|
|
def header_fetch_parse(self, name: str, value: str) -> Any: ...
|
|
def fold(self, name: str, value: str) -> Any: ...
|
|
def fold_binary(self, name: str, value: str) -> bytes: ...
|
|
|
|
default: EmailPolicy
|
|
SMTP: EmailPolicy
|
|
SMTPUTF8: EmailPolicy
|
|
HTTP: EmailPolicy
|
|
strict: EmailPolicy
|