mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Drop Python 3.3 support from email stubs (#2263)
This commit is contained in:
committed by
Jelle Zijlstra
parent
40b176b195
commit
1184726417
@@ -3,32 +3,17 @@
|
||||
from typing import Callable, Optional, IO
|
||||
import sys
|
||||
from email.message import Message
|
||||
if sys.version_info >= (3, 3):
|
||||
from email.policy import Policy
|
||||
from email.policy import Policy
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
def message_from_string(s: str, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_bytes(s: bytes, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_file(fp: IO[str], _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_binary_file(fp: IO[bytes],
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
elif sys.version_info >= (3, 2):
|
||||
def message_from_string(s: str,
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
strict: Optional[bool] = ...) -> Message: ...
|
||||
def message_from_bytes(s: bytes,
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
strict: Optional[bool] = ...) -> Message: ...
|
||||
def message_from_file(fp: IO[str],
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
strict: Optional[bool] = ...) -> Message: ...
|
||||
def message_from_binary_file(fp: IO[bytes],
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
strict: Optional[bool] = ...) -> Message: ...
|
||||
def message_from_string(s: str, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_bytes(s: bytes, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_file(fp: IO[str], _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_binary_file(fp: IO[bytes],
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
|
||||
# Names in __all__ with no definition:
|
||||
# base64mime
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
# Stubs for email.contentmanager (Python 3.4)
|
||||
|
||||
from typing import Any, Callable
|
||||
import sys
|
||||
from email.message import Message
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
class ContentManager:
|
||||
def __init__(self) -> None: ...
|
||||
def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ...
|
||||
def set_content(self, msg: Message, obj: Any, *args: Any,
|
||||
**kw: Any) -> Any: ...
|
||||
def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ...
|
||||
def add_set_handler(self, typekey: type,
|
||||
handler: Callable[..., Any]) -> None: ...
|
||||
|
||||
class ContentManager:
|
||||
def __init__(self) -> None: ...
|
||||
def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ...
|
||||
def set_content(self, msg: Message, obj: Any, *args: Any,
|
||||
**kw: Any) -> Any: ...
|
||||
def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ...
|
||||
def add_set_handler(self, typekey: type,
|
||||
handler: Callable[..., Any]) -> None: ...
|
||||
|
||||
raw_data_manager = ... # type: ContentManager
|
||||
raw_data_manager = ... # type: ContentManager
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# Stubs for email.errors (Python 3.4)
|
||||
|
||||
import sys
|
||||
|
||||
class MessageError(Exception): ...
|
||||
class MessageParseError(MessageError): ...
|
||||
class HeaderParseError(MessageParseError): ...
|
||||
@@ -17,6 +15,5 @@ class MalformedHeaderDefect(MessageDefect): ...
|
||||
class MultipartInvariantViolationDefect(MessageDefect): ...
|
||||
class InvalidBase64PaddingDefect(MessageDefect): ...
|
||||
class InvalidBase64CharactersDefect(MessageDefect): ...
|
||||
if sys.version_info >= (3, 3):
|
||||
class CloseBoundaryNotFoundDefect(MessageDefect): ...
|
||||
class MissingHeaderBodySeparatorDefect(MessageDefect): ...
|
||||
class CloseBoundaryNotFoundDefect(MessageDefect): ...
|
||||
class MissingHeaderBodySeparatorDefect(MessageDefect): ...
|
||||
|
||||
@@ -3,26 +3,16 @@
|
||||
from typing import Callable
|
||||
import sys
|
||||
from email.message import Message
|
||||
if sys.version_info >= (3, 3):
|
||||
from email.policy import Policy
|
||||
from email.policy import Policy
|
||||
|
||||
class FeedParser:
|
||||
if sys.version_info >= (3, 3):
|
||||
def __init__(self, _factory: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self,
|
||||
_factory: Callable[[], Message] = ...) -> None: ...
|
||||
def __init__(self, _factory: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def feed(self, data: str) -> None: ...
|
||||
def close(self) -> Message: ...
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
class BytesFeedParser:
|
||||
if sys.version_info >= (3, 3):
|
||||
def __init__(self, _factory: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self,
|
||||
_factory: Callable[[], Message] = ...) -> None: ...
|
||||
def feed(self, data: str) -> None: ...
|
||||
def close(self) -> Message: ...
|
||||
class BytesFeedParser:
|
||||
def __init__(self, _factory: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def feed(self, data: str) -> None: ...
|
||||
def close(self) -> Message: ...
|
||||
|
||||
@@ -1,43 +1,26 @@
|
||||
# Stubs for email.generator (Python 3.4)
|
||||
|
||||
from typing import TextIO, Optional
|
||||
import sys
|
||||
from email.message import Message
|
||||
if sys.version_info >= (3, 3):
|
||||
from email.policy import Policy
|
||||
from email.policy import Policy
|
||||
|
||||
class Generator:
|
||||
def clone(self, fp: TextIO) -> 'Generator': ...
|
||||
def write(self, s: str) -> None: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def __init__(self, outfp: TextIO, mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, outfp: TextIO,
|
||||
mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ...) -> None: ...
|
||||
if sys.version_info >= (3, 2):
|
||||
def flatten(self, msg: Message, unixfrom: bool = ...,
|
||||
linesep: Optional[str] =...) -> None: ...
|
||||
else:
|
||||
def flatten(self, msg: Message,
|
||||
unixfrom: bool = ...) -> None: ...
|
||||
def __init__(self, outfp: TextIO, mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def flatten(self, msg: Message, unixfrom: bool = ...,
|
||||
linesep: Optional[str] =...) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
class BytesGenerator:
|
||||
def clone(self, fp: TextIO) -> 'Generator': ...
|
||||
def write(self, s: str) -> None: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def __init__(self, outfp: TextIO, mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, outfp: TextIO,
|
||||
mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ...) -> None: ...
|
||||
def flatten(self, msg: Message, unixfrom: bool = ...,
|
||||
linesep: Optional[str] =...) -> None: ...
|
||||
class BytesGenerator:
|
||||
def clone(self, fp: TextIO) -> 'Generator': ...
|
||||
def write(self, s: str) -> None: ...
|
||||
def __init__(self, outfp: TextIO, mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def flatten(self, msg: Message, unixfrom: bool = ...,
|
||||
linesep: Optional[str] =...) -> None: ...
|
||||
|
||||
class DecodedGenerator(Generator):
|
||||
# TODO `fmt` is positional
|
||||
|
||||
@@ -1,101 +1,97 @@
|
||||
# Stubs for email.headerregistry (Python 3.4)
|
||||
|
||||
from datetime import datetime as _datetime
|
||||
import sys
|
||||
from typing import Dict, Tuple, Optional, Any, Union, Mapping
|
||||
from email.errors import MessageDefect
|
||||
if sys.version_info >= (3, 3):
|
||||
from email.policy import Policy
|
||||
from email.policy import Policy
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
class BaseHeader(str):
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def defects(self) -> Tuple[MessageDefect, ...]: ...
|
||||
@property
|
||||
def max_count(self) -> Optional[int]: ...
|
||||
def __new__(cls, name: str, value: Any) -> 'BaseHeader': ...
|
||||
def init(self, *args: Any, **kw: Any) -> None: ...
|
||||
def fold(self, *, policy: Policy) -> str: ...
|
||||
|
||||
class BaseHeader(str):
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def defects(self) -> Tuple[MessageDefect, ...]: ...
|
||||
@property
|
||||
def max_count(self) -> Optional[int]: ...
|
||||
def __new__(cls, name: str, value: Any) -> 'BaseHeader': ...
|
||||
def init(self, *args: Any, **kw: Any) -> None: ...
|
||||
def fold(self, *, policy: Policy) -> str: ...
|
||||
class UnstructuredHeader:
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
|
||||
class UnstructuredHeader:
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
class UniqueUnstructuredHeader(UnstructuredHeader): ...
|
||||
|
||||
class UniqueUnstructuredHeader(UnstructuredHeader): ...
|
||||
class DateHeader:
|
||||
datetime = ... # type: _datetime
|
||||
@classmethod
|
||||
def parse(cls, string: Union[str, _datetime],
|
||||
kwds: Dict[str, Any]) -> None: ...
|
||||
|
||||
class DateHeader:
|
||||
datetime = ... # type: _datetime
|
||||
@classmethod
|
||||
def parse(cls, string: Union[str, _datetime],
|
||||
kwds: Dict[str, Any]) -> None: ...
|
||||
class UniqueDateHeader(DateHeader): ...
|
||||
|
||||
class UniqueDateHeader(DateHeader): ...
|
||||
class AddressHeader:
|
||||
groups = ... # type: Tuple[Group, ...]
|
||||
addresses = ... # type: Tuple[Address, ...]
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
|
||||
class AddressHeader:
|
||||
groups = ... # type: Tuple[Group, ...]
|
||||
addresses = ... # type: Tuple[Address, ...]
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
class UniqueAddressHeader(AddressHeader): ...
|
||||
|
||||
class UniqueAddressHeader(AddressHeader): ...
|
||||
class SingleAddressHeader(AddressHeader):
|
||||
@property
|
||||
def address(self) -> Address: ...
|
||||
|
||||
class SingleAddressHeader(AddressHeader):
|
||||
@property
|
||||
def address(self) -> Address: ...
|
||||
class UniqueSingleAddressHeader(SingleAddressHeader): ...
|
||||
|
||||
class UniqueSingleAddressHeader(SingleAddressHeader): ...
|
||||
class MIMEVersionHeader:
|
||||
version = ... # type: Optional[str]
|
||||
major = ... # type: Optional[int]
|
||||
minor = ... # type: Optional[int]
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
|
||||
class MIMEVersionHeader:
|
||||
version = ... # type: Optional[str]
|
||||
major = ... # type: Optional[int]
|
||||
minor = ... # type: Optional[int]
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
class ParameterizedMIMEHeader:
|
||||
params = ... # type: Mapping[str, Any]
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
|
||||
class ParameterizedMIMEHeader:
|
||||
params = ... # type: Mapping[str, Any]
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
class ContentTypeHeader(ParameterizedMIMEHeader):
|
||||
content_type = ... # type: str
|
||||
maintype = ... # type: str
|
||||
subtype = ... # type: str
|
||||
|
||||
class ContentTypeHeader(ParameterizedMIMEHeader):
|
||||
content_type = ... # type: str
|
||||
maintype = ... # type: str
|
||||
subtype = ... # type: str
|
||||
class ContentDispositionHeader(ParameterizedMIMEHeader):
|
||||
content_disposition = ... # type: str
|
||||
|
||||
class ContentDispositionHeader(ParameterizedMIMEHeader):
|
||||
content_disposition = ... # type: str
|
||||
class ContentTransferEncodingHeader:
|
||||
cte = ... # type: str
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
|
||||
class ContentTransferEncodingHeader:
|
||||
cte = ... # type: str
|
||||
@classmethod
|
||||
def parse(cls, string: str, kwds: Dict[str, Any]) -> None: ...
|
||||
class HeaderRegistry:
|
||||
def __init__(self, base_class: BaseHeader = ...,
|
||||
default_class: BaseHeader = ...,
|
||||
use_default_map: bool = ...) -> None: ...
|
||||
def map_to_type(self, name: str, cls: BaseHeader) -> None: ...
|
||||
def __getitem__(self, name: str) -> BaseHeader: ...
|
||||
def __call__(self, name: str, value: Any) -> BaseHeader: ...
|
||||
|
||||
class HeaderRegistry:
|
||||
def __init__(self, base_class: BaseHeader = ...,
|
||||
default_class: BaseHeader = ...,
|
||||
use_default_map: bool = ...) -> None: ...
|
||||
def map_to_type(self, name: str, cls: BaseHeader) -> None: ...
|
||||
def __getitem__(self, name: str) -> BaseHeader: ...
|
||||
def __call__(self, name: str, value: Any) -> BaseHeader: ...
|
||||
class Address:
|
||||
display_name = ... # type: str
|
||||
username = ... # type: str
|
||||
domain = ... # type: str
|
||||
@property
|
||||
def addr_spec(self) -> str: ...
|
||||
def __init__(self, display_name: str = ...,
|
||||
username: Optional[str] = ...,
|
||||
domain: Optional[str] = ...,
|
||||
addr_spec: Optional[str]=...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
class Address:
|
||||
display_name = ... # type: str
|
||||
username = ... # type: str
|
||||
domain = ... # type: str
|
||||
@property
|
||||
def addr_spec(self) -> str: ...
|
||||
def __init__(self, display_name: str = ...,
|
||||
username: Optional[str] = ...,
|
||||
domain: Optional[str] = ...,
|
||||
addr_spec: Optional[str]=...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
class Group:
|
||||
display_name = ... # type: Optional[str]
|
||||
addresses = ... # type: Tuple[Address, ...]
|
||||
def __init__(self, display_name: Optional[str] = ...,
|
||||
addresses: Optional[Tuple[Address, ...]] = ...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
class Group:
|
||||
display_name = ... # type: Optional[str]
|
||||
addresses = ... # type: Tuple[Address, ...]
|
||||
def __init__(self, display_name: Optional[str] = ...,
|
||||
addresses: Optional[Tuple[Address, ...]] = ...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
@@ -7,12 +7,8 @@ import sys
|
||||
from email.charset import Charset
|
||||
from email.errors import MessageDefect
|
||||
from email.header import Header
|
||||
if sys.version_info >= (3, 3):
|
||||
from email.policy import Policy
|
||||
if sys.version_info >= (3, 4):
|
||||
from email.contentmanager import ContentManager
|
||||
else:
|
||||
ContentManager = object # Hack so we can reference it in argument types.
|
||||
from email.policy import Policy
|
||||
from email.contentmanager import ContentManager
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
@@ -69,25 +65,15 @@ class Message:
|
||||
def walk(self) -> Generator['Message', None, None]: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def get_content_disposition(self) -> Optional[str]: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ...,
|
||||
policy: Optional[Policy] = ...) -> str: ...
|
||||
def as_bytes(self, unixfrom: bool = ...,
|
||||
policy: Optional[Policy] = ...) -> bytes: ...
|
||||
def __bytes__(self) -> bytes: ...
|
||||
def set_param(self, param: str, value: str, header: str = ...,
|
||||
requote: bool = ..., charset: str = ...,
|
||||
language: str = ..., replace: bool = ...) -> None: ...
|
||||
else:
|
||||
def as_string(self, unixfrom: bool = ...,
|
||||
maxheaderlen: int = ...) -> str: ...
|
||||
def set_param(self, param: str, value: str,
|
||||
header: str = ..., requote: bool = ...,
|
||||
charset: str = ..., language: str = ...) -> None: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def __init__(self, policy: Policy = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self) -> None: ...
|
||||
def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ...,
|
||||
policy: Optional[Policy] = ...) -> str: ...
|
||||
def as_bytes(self, unixfrom: bool = ...,
|
||||
policy: Optional[Policy] = ...) -> bytes: ...
|
||||
def __bytes__(self) -> bytes: ...
|
||||
def set_param(self, param: str, value: str, header: str = ...,
|
||||
requote: bool = ..., charset: str = ...,
|
||||
language: str = ..., replace: bool = ...) -> None: ...
|
||||
def __init__(self, policy: Policy = ...) -> None: ...
|
||||
|
||||
class MIMEPart(Message):
|
||||
def get_body(self,
|
||||
@@ -114,10 +100,6 @@ class MIMEPart(Message):
|
||||
**kw: Any) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def clear_content(self) -> None: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
def is_attachment(self) -> bool: ...
|
||||
else:
|
||||
@property
|
||||
def is_attachment(self) -> bool: ...
|
||||
def is_attachment(self) -> bool: ...
|
||||
|
||||
class EmailMessage(MIMEPart): ...
|
||||
|
||||
@@ -2,60 +2,32 @@
|
||||
|
||||
import email.feedparser
|
||||
from email.message import Message
|
||||
import sys
|
||||
from typing import Callable, Optional, TextIO, BinaryIO
|
||||
if sys.version_info >= (3, 3):
|
||||
from email.policy import Policy
|
||||
from email.policy import Policy
|
||||
|
||||
FeedParser = email.feedparser.FeedParser
|
||||
BytesFeedParser = email.feedparser.BytesFeedParser
|
||||
|
||||
class Parser:
|
||||
if sys.version_info >= (3, 3):
|
||||
def __init__(self, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
else:
|
||||
# TODO `strict` is positional
|
||||
def __init__(self,
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
strict: Optional[bool]) -> None: ...
|
||||
def __init__(self, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ...
|
||||
def parsestr(self, text: str, headersonly: bool = ...) -> Message: ...
|
||||
|
||||
class HeaderParser(Parser):
|
||||
if sys.version_info >= (3, 3):
|
||||
def __init__(self, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
else:
|
||||
# TODO `strict` is positional
|
||||
def __init__(self,
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
strict: Optional[bool]) -> None: ...
|
||||
def __init__(self, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def parse(self, fp: TextIO, headersonly: bool = ...) -> Message: ...
|
||||
def parsestr(self, text: str, headersonly: bool = ...) -> Message: ...
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
class BytesHeaderParser(BytesParser):
|
||||
if sys.version_info >= (3, 3):
|
||||
def __init__(self, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
else:
|
||||
# TODO `strict` is positional
|
||||
def __init__(self,
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
strict: Optional[bool]) -> None: ...
|
||||
def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ...
|
||||
def parsestr(self, text: str, headersonly: bool = ...) -> Message: ...
|
||||
class BytesHeaderParser(BytesParser):
|
||||
def __init__(self, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ...
|
||||
def parsestr(self, text: str, headersonly: bool = ...) -> Message: ...
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
class BytesParser:
|
||||
if sys.version_info >= (3, 3):
|
||||
def __init__(self, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
else:
|
||||
# TODO `strict` is positional
|
||||
def __init__(self,
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
strict: Optional[bool]) -> None: ...
|
||||
def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ...
|
||||
def parsestr(self, text: str, headersonly: bool = ...) -> Message: ...
|
||||
class BytesParser:
|
||||
def __init__(self, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def parse(self, fp: BinaryIO, headersonly: bool = ...) -> Message: ...
|
||||
def parsestr(self, text: str, headersonly: bool = ...) -> Message: ...
|
||||
|
||||
@@ -6,63 +6,59 @@ import sys
|
||||
from email.message import Message
|
||||
from email.errors import MessageDefect
|
||||
from email.header import Header
|
||||
if sys.version_info >= (3, 4):
|
||||
from email.contentmanager import ContentManager
|
||||
from email.contentmanager import ContentManager
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
class Policy:
|
||||
max_line_length = ... # type: Optional[int]
|
||||
linesep = ... # type: str
|
||||
cte_type = ... # type: str
|
||||
raise_on_defect = ... # type: bool
|
||||
if sys.version_info >= (3, 5):
|
||||
mange_from = ... # type: bool
|
||||
def __init__(self, **kw: Any) -> None: ...
|
||||
def clone(self, **kw: Any) -> 'Policy': ...
|
||||
def handle_defect(self, obj: Message,
|
||||
defect: MessageDefect) -> None: ...
|
||||
def register_defect(self, obj: Message,
|
||||
defect: MessageDefect) -> None: ...
|
||||
def header_max_count(self, name: str) -> Optional[int]: ...
|
||||
@abstractmethod
|
||||
def header_source_parse(self, sourcelines: List[str]) -> str: ...
|
||||
@abstractmethod
|
||||
def header_store_parse(self, name: str,
|
||||
value: str) -> Tuple[str, str]: ...
|
||||
@abstractmethod
|
||||
def header_fetch_parse(self, name: str,
|
||||
value: str) -> str: ...
|
||||
@abstractmethod
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
@abstractmethod
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
|
||||
class Policy:
|
||||
max_line_length = ... # type: Optional[int]
|
||||
linesep = ... # type: str
|
||||
cte_type = ... # type: str
|
||||
raise_on_defect = ... # type: bool
|
||||
if sys.version_info >= (3, 5):
|
||||
mange_from = ... # type: bool
|
||||
def __init__(self, **kw: Any) -> None: ...
|
||||
def clone(self, **kw: Any) -> 'Policy': ...
|
||||
def handle_defect(self, obj: Message,
|
||||
defect: MessageDefect) -> None: ...
|
||||
def register_defect(self, obj: Message,
|
||||
defect: MessageDefect) -> None: ...
|
||||
def header_max_count(self, name: str) -> Optional[int]: ...
|
||||
@abstractmethod
|
||||
def header_source_parse(self, sourcelines: List[str]) -> str: ...
|
||||
@abstractmethod
|
||||
def header_store_parse(self, name: str,
|
||||
value: str) -> Tuple[str, str]: ...
|
||||
@abstractmethod
|
||||
def header_fetch_parse(self, name: str,
|
||||
value: str) -> str: ...
|
||||
@abstractmethod
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
@abstractmethod
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
class Compat32(Policy):
|
||||
def header_source_parse(self, sourcelines: List[str]) -> str: ...
|
||||
def header_store_parse(self, name: str,
|
||||
value: str) -> Tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> Union[str, Header]: ... # type: ignore
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
|
||||
class Compat32(Policy):
|
||||
def header_source_parse(self, sourcelines: List[str]) -> str: ...
|
||||
def header_store_parse(self, name: str,
|
||||
value: str) -> Tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> Union[str, Header]: ... # type: ignore
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
compat32 = ... # type: Compat32
|
||||
|
||||
compat32 = ... # type: Compat32
|
||||
class EmailPolicy(Policy):
|
||||
utf8 = ... # type: bool
|
||||
refold_source = ... # type: str
|
||||
header_factory = ... # type: Callable[[str, str], str]
|
||||
content_manager = ... # type: ContentManager
|
||||
def header_source_parse(self, sourcelines: List[str]) -> str: ...
|
||||
def header_store_parse(self, name: str,
|
||||
value: str) -> Tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> str: ...
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
|
||||
class EmailPolicy(Policy):
|
||||
utf8 = ... # type: bool
|
||||
refold_source = ... # type: str
|
||||
header_factory = ... # type: Callable[[str, str], str]
|
||||
if sys.version_info >= (3, 4):
|
||||
content_manager = ... # type: ContentManager
|
||||
def header_source_parse(self, sourcelines: List[str]) -> str: ...
|
||||
def header_store_parse(self, name: str,
|
||||
value: str) -> Tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> str: ...
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
|
||||
default = ... # type: EmailPolicy
|
||||
SMTP = ... # type: EmailPolicy
|
||||
SMTPUTF8 = ... # type: EmailPolicy
|
||||
HTTP = ... # type: EmailPolicy
|
||||
strict = ... # type: EmailPolicy
|
||||
default = ... # type: EmailPolicy
|
||||
SMTP = ... # type: EmailPolicy
|
||||
SMTPUTF8 = ... # type: EmailPolicy
|
||||
HTTP = ... # type: EmailPolicy
|
||||
strict = ... # type: EmailPolicy
|
||||
|
||||
Reference in New Issue
Block a user