1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
# Stubs for email.parser (Python 3.4)
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
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 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 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: ...
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: ...
|