filled in stub files
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import datetime
|
||||
from email._policybase import Policy
|
||||
from imaplib import IMAP4, IMAP4_SSL
|
||||
from inspect import Traceback
|
||||
from ssl import SSLContext
|
||||
from typing import Optional, Union, List, Tuple, Generator
|
||||
|
||||
from imbox.parser import Struct
|
||||
from typing import Optional, Union, Tuple, List
|
||||
|
||||
|
||||
class Imbox:
|
||||
@@ -31,28 +28,4 @@ class Imbox:
|
||||
|
||||
def messages(self, **kwargs: Union[bool, str, datetime.date]) -> 'Messages': ...
|
||||
|
||||
def folders(self) -> Tuple[str, List[bytes]]: ...
|
||||
|
||||
|
||||
class Messages:
|
||||
|
||||
def __init__(self,
|
||||
connection: Union[IMAP4, IMAP4_SSL],
|
||||
parser_policy: Policy,
|
||||
**kwargs: Union[bool, str, datetime.date]) -> None: ...
|
||||
|
||||
def _fetch_email(self, uid: bytes) -> 'Struct': ...
|
||||
|
||||
def _query_uids(self, **kwargs: Union[bool, str, datetime.date]) -> List[bytes]: ...
|
||||
|
||||
def _fetch_email_list(self) -> Generator[Tuple[bytes, 'Struct']]: ...
|
||||
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
def __iter__(self) -> Generator[Tuple[bytes, 'Struct']]: ...
|
||||
|
||||
def __next__(self) -> 'Messages': ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
def __getitem__(self, index) -> Union['Struct', List['Struct']]: ...
|
||||
def folders(self) -> Tuple[str, List[bytes]]: ...
|
||||
28
imbox/messages.pyi
Normal file
28
imbox/messages.pyi
Normal file
@@ -0,0 +1,28 @@
|
||||
import datetime
|
||||
from email._policybase import Policy
|
||||
from imaplib import IMAP4, IMAP4_SSL
|
||||
from typing import Union, List, Generator, Tuple
|
||||
|
||||
|
||||
class Messages:
|
||||
|
||||
def __init__(self,
|
||||
connection: Union[IMAP4, IMAP4_SSL],
|
||||
parser_policy: Policy,
|
||||
**kwargs: Union[bool, str, datetime.date]) -> None: ...
|
||||
|
||||
def _fetch_email(self, uid: bytes) -> 'Struct': ...
|
||||
|
||||
def _query_uids(self, **kwargs: Union[bool, str, datetime.date]) -> List[bytes]: ...
|
||||
|
||||
def _fetch_email_list(self) -> Generator[Tuple[bytes, 'Struct']]: ...
|
||||
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
def __iter__(self) -> Generator[Tuple[bytes, 'Struct']]: ...
|
||||
|
||||
def __next__(self) -> 'Messages': ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
def __getitem__(self, index) -> Union['Struct', List['Struct']]: ...
|
||||
@@ -0,0 +1,30 @@
|
||||
import datetime
|
||||
from email._policybase import Policy
|
||||
from email.message import Message
|
||||
from imaplib import IMAP4_SSL
|
||||
import io
|
||||
from typing import Union, Dict, List, KeysView, Tuple, Optional
|
||||
|
||||
|
||||
class Struct:
|
||||
def __init__(self, **entries: Union[
|
||||
str, datetime.datetime, Dict[str, str], list, List[Dict[str, str]]
|
||||
]) -> None: ...
|
||||
|
||||
def keys(self) -> KeysView: ...
|
||||
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
def decode_mail_header(value: str, default_charset: str) -> str: ...
|
||||
|
||||
def get_mail_addresses(message: Message, header_name: str) -> List[Dict[str, str]]: ...
|
||||
|
||||
def decode_param(param: str) -> Tuple[str, str]: ...
|
||||
|
||||
def parse_attachment(message_part: Message) -> Optional[Dict[str, Union[int, str, io.BytesIO]]]: ...
|
||||
|
||||
def decode_content(message: Message) -> str: ...
|
||||
|
||||
def fetch_email_by_uid(uid: bytes, connection: IMAP4_SSL, parser_policy: Optional[Policy]) -> Struct: ...
|
||||
|
||||
def parse_email(raw_email: bytes, policy: Optional[Policy]) -> Struct: ...
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import datetime
|
||||
from typing import Union
|
||||
|
||||
|
||||
def format_date(date: Union[str, datetime.date]) -> str: ...
|
||||
|
||||
def build_search_query(**kwargs: Union[bool, str, datetime.date]) -> str: ...
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
from typing import Optional, Union
|
||||
|
||||
|
||||
def str_encode(value: Union[str, bytes], encoding: Optional[str], errors: str) -> str: ...
|
||||
|
||||
def str_decode(value: Union[str, bytes], encoding: Optional[str], errors: str) -> Union[str, bytes]: ...
|
||||
|
||||
Reference in New Issue
Block a user