mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-19 02:15:59 +08:00
better stubs
This commit is contained in:
@@ -1,22 +1,20 @@
|
||||
# Stubs for django.core.mail (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.core.mail.message import (
|
||||
BadHeaderError as BadHeaderError,
|
||||
DEFAULT_ATTACHMENT_MIME_TYPE as DEFAULT_ATTACHMENT_MIME_TYPE,
|
||||
EmailMessage as EmailMessage,
|
||||
EmailMultiAlternatives as EmailMultiAlternatives,
|
||||
SafeMIMEMultipart as SafeMIMEMultipart,
|
||||
SafeMIMEText as SafeMIMEText,
|
||||
forbid_multi_line_headers as forbid_multi_line_headers,
|
||||
make_msgid as make_msgid,
|
||||
)
|
||||
from django.core.mail.utils import CachedDnsName as CachedDnsName, DNS_NAME as DNS_NAME
|
||||
from typing import Any, Optional
|
||||
from typing import Any, List, Optional, Tuple
|
||||
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
from typing import List, Optional, Tuple
|
||||
from django.core.mail.message import \
|
||||
DEFAULT_ATTACHMENT_MIME_TYPE as DEFAULT_ATTACHMENT_MIME_TYPE
|
||||
from django.core.mail.message import BadHeaderError as BadHeaderError
|
||||
from django.core.mail.message import EmailMessage as EmailMessage
|
||||
from django.core.mail.message import \
|
||||
EmailMultiAlternatives as EmailMultiAlternatives
|
||||
from django.core.mail.message import SafeMIMEMultipart as SafeMIMEMultipart
|
||||
from django.core.mail.message import SafeMIMEText as SafeMIMEText
|
||||
from django.core.mail.message import \
|
||||
forbid_multi_line_headers as forbid_multi_line_headers
|
||||
from django.core.mail.message import make_msgid as make_msgid
|
||||
from django.core.mail.utils import DNS_NAME as DNS_NAME
|
||||
from django.core.mail.utils import CachedDnsName as CachedDnsName
|
||||
|
||||
|
||||
def get_connection(
|
||||
backend: Optional[str] = ..., fail_silently: bool = ..., **kwds: Any
|
||||
@@ -50,6 +48,6 @@ def mail_managers(
|
||||
subject: str,
|
||||
message: str,
|
||||
fail_silently: bool = ...,
|
||||
connection: None = ...,
|
||||
html_message: None = ...,
|
||||
connection: Optional[BaseEmailBackend] = ...,
|
||||
html_message: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# Stubs for django.core.mail.backends.base (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any
|
||||
|
||||
class BaseEmailBackend:
|
||||
fail_silently: Any = ...
|
||||
@@ -10,5 +7,7 @@ class BaseEmailBackend:
|
||||
def open(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def __enter__(self) -> BaseEmailBackend: ...
|
||||
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
|
||||
def __exit__(
|
||||
self, exc_type: None, exc_value: None, traceback: None
|
||||
) -> None: ...
|
||||
def send_messages(self, email_messages: Any) -> None: ...
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
# Stubs for django.core.mail.backends.console (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Iterator, List, Optional, Union
|
||||
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
from typing import Any
|
||||
from django.core.mail.message import EmailMessage
|
||||
|
||||
from django.core.mail.message import EmailMessage, EmailMultiAlternatives
|
||||
from typing import List, Union
|
||||
|
||||
class EmailBackend(BaseEmailBackend):
|
||||
stream: Any = ...
|
||||
_lock: Any = ...
|
||||
fail_silently: bool
|
||||
stream: _io.StringIO = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def write_message(self, message: EmailMultiAlternatives) -> None: ...
|
||||
def write_message(self, message: EmailMessage) -> None: ...
|
||||
def send_messages(
|
||||
self, email_messages: Union[List[EmailMultiAlternatives], List[EmailMessage]]
|
||||
self, email_messages: Union[List[EmailMessage], Iterator[Any]]
|
||||
) -> int: ...
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
# Stubs for django.core.mail.backends.dummy (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
from typing import Any
|
||||
|
||||
from django.core.mail.message import EmailMessage
|
||||
from typing import List
|
||||
|
||||
|
||||
class EmailBackend(BaseEmailBackend):
|
||||
fail_silently: bool
|
||||
def send_messages(self, email_messages: List[EmailMessage]) -> int: ...
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
# Stubs for django.core.mail.backends.filebased (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.mail.backends.console import \
|
||||
EmailBackend as ConsoleEmailBackend
|
||||
from django.core.mail.message import EmailMessage
|
||||
|
||||
|
||||
class EmailBackend(ConsoleEmailBackend):
|
||||
_fname: Any = ...
|
||||
file_path: Any = ...
|
||||
fail_silently: bool
|
||||
file_path: str = ...
|
||||
def __init__(
|
||||
self, *args: Any, file_path: Optional[Any] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def write_message(self, message: EmailMessage) -> None: ...
|
||||
def _get_filename(self) -> str: ...
|
||||
stream: Any = ...
|
||||
stream: None = ...
|
||||
def open(self) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
# Stubs for django.core.mail.backends.locmem (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Iterator, List, Optional, Union
|
||||
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
from typing import Any
|
||||
from django.core.mail.message import EmailMessage
|
||||
|
||||
from django.core.mail.message import EmailMessage, EmailMultiAlternatives
|
||||
from typing import List, Union
|
||||
|
||||
class EmailBackend(BaseEmailBackend):
|
||||
fail_silently: bool
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def send_messages(
|
||||
self, messages: Union[List[EmailMultiAlternatives], List[EmailMessage]]
|
||||
self, messages: Union[List[EmailMessage], Iterator[Any]]
|
||||
) -> int: ...
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
# Stubs for django.core.mail.backends.smtp (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from smtplib import SMTP
|
||||
from typing import Any, Iterator, List, Optional, Type, Union
|
||||
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.mail.message import EmailMessage
|
||||
from smtplib import SMTP
|
||||
from typing import List, Optional, Type
|
||||
|
||||
|
||||
class EmailBackend(BaseEmailBackend):
|
||||
fail_silently: bool
|
||||
host: Any = ...
|
||||
port: Any = ...
|
||||
username: Any = ...
|
||||
@@ -20,24 +17,24 @@ class EmailBackend(BaseEmailBackend):
|
||||
ssl_keyfile: Any = ...
|
||||
ssl_certfile: Any = ...
|
||||
connection: Any = ...
|
||||
_lock: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
host: None = ...,
|
||||
port: None = ...,
|
||||
username: Optional[str] = ...,
|
||||
password: Optional[str] = ...,
|
||||
use_tls: None = ...,
|
||||
use_tls: Optional[bool] = ...,
|
||||
fail_silently: bool = ...,
|
||||
use_ssl: None = ...,
|
||||
use_ssl: Optional[bool] = ...,
|
||||
timeout: None = ...,
|
||||
ssl_keyfile: None = ...,
|
||||
ssl_certfile: None = ...,
|
||||
**kwargs: Any,
|
||||
ssl_keyfile: Optional[str] = ...,
|
||||
ssl_certfile: Optional[str] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
@property
|
||||
def connection_class(self) -> Type[SMTP]: ...
|
||||
def open(self) -> bool: ...
|
||||
def open(self) -> Optional[bool]: ...
|
||||
def close(self) -> None: ...
|
||||
def send_messages(self, email_messages: List[EmailMessage]) -> int: ...
|
||||
def _send(self, email_message: EmailMessage) -> bool: ...
|
||||
def send_messages(
|
||||
self, email_messages: Union[List[EmailMessage], Iterator[Any]]
|
||||
) -> int: ...
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
# Stubs for django.core.mail.message (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from email.mime.message import MIMEMessage
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from typing import Any, Optional
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
from email.mime.base import MIMEBase
|
||||
from typing import Dict, List, Optional, Tuple, Union
|
||||
|
||||
utf8_charset: Any
|
||||
utf8_charset_qp: Any
|
||||
@@ -20,32 +14,50 @@ class BadHeaderError(ValueError): ...
|
||||
|
||||
ADDRESS_HEADERS: Any
|
||||
|
||||
def forbid_multi_line_headers(name: str, val: str, encoding: str) -> Tuple[str, str]: ...
|
||||
def forbid_multi_line_headers(
|
||||
name: str, val: str, encoding: str
|
||||
) -> Tuple[str, str]: ...
|
||||
def split_addr(addr: str, encoding: str) -> Tuple[str, str]: ...
|
||||
def sanitize_address(addr: Union[str, Tuple[str, str]], encoding: str) -> str: ...
|
||||
def sanitize_address(
|
||||
addr: Union[str, Tuple[str, str]], encoding: str
|
||||
) -> str: ...
|
||||
|
||||
class MIMEMixin:
|
||||
def as_string(self, unixfrom: bool = ..., linesep: str = ...) -> str: ...
|
||||
def as_bytes(self, unixfrom: bool = ..., linesep: str = ...) -> bytes: ...
|
||||
|
||||
class SafeMIMEMessage(MIMEMixin, MIMEMessage):
|
||||
defects: List[Any]
|
||||
epilogue: None
|
||||
policy: email._policybase.Compat32
|
||||
preamble: None
|
||||
def __setitem__(self, name: str, val: str) -> None: ...
|
||||
|
||||
class SafeMIMEText(MIMEMixin, MIMEText):
|
||||
encoding: Any = ...
|
||||
def __init__(self, _text: str, _subtype: str = ..., _charset: str = ...) -> None: ...
|
||||
defects: List[Any]
|
||||
epilogue: None
|
||||
policy: email._policybase.Compat32
|
||||
preamble: None
|
||||
encoding: str = ...
|
||||
def __init__(
|
||||
self, _text: str, _subtype: str = ..., _charset: str = ...
|
||||
) -> None: ...
|
||||
def __setitem__(self, name: str, val: str) -> None: ...
|
||||
def set_payload(self, payload: str, charset: str = ...) -> None: ...
|
||||
|
||||
class SafeMIMEMultipart(MIMEMixin, MIMEMultipart):
|
||||
encoding: Any = ...
|
||||
defects: List[Any]
|
||||
epilogue: None
|
||||
policy: email._policybase.Compat32
|
||||
preamble: None
|
||||
encoding: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
_subtype: str = ...,
|
||||
boundary: None = ...,
|
||||
_subparts: None = ...,
|
||||
encoding: str = ...,
|
||||
**_params: Any,
|
||||
**_params: Any
|
||||
) -> None: ...
|
||||
def __setitem__(self, name: str, val: str) -> None: ...
|
||||
|
||||
@@ -53,57 +65,54 @@ class EmailMessage:
|
||||
content_subtype: str = ...
|
||||
mixed_subtype: str = ...
|
||||
encoding: Any = ...
|
||||
to: Any = ...
|
||||
cc: Any = ...
|
||||
bcc: Any = ...
|
||||
reply_to: Any = ...
|
||||
from_email: Any = ...
|
||||
subject: Any = ...
|
||||
body: Any = ...
|
||||
attachments: Any = ...
|
||||
extra_headers: Any = ...
|
||||
connection: Any = ...
|
||||
to: List[str] = ...
|
||||
cc: List[Any] = ...
|
||||
bcc: List[Any] = ...
|
||||
reply_to: List[Any] = ...
|
||||
from_email: str = ...
|
||||
subject: str = ...
|
||||
body: str = ...
|
||||
attachments: List[Any] = ...
|
||||
extra_headers: Dict[Any, Any] = ...
|
||||
connection: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
subject: str = ...,
|
||||
body: str = ...,
|
||||
body: Optional[str] = ...,
|
||||
from_email: Optional[str] = ...,
|
||||
to: Optional[List[str]] = ...,
|
||||
bcc: None = ...,
|
||||
to: Optional[Union[List[str], str, Tuple[str, str]]] = ...,
|
||||
bcc: Optional[Union[str, List[str], Tuple[str]]] = ...,
|
||||
connection: Optional[BaseEmailBackend] = ...,
|
||||
attachments: Optional[List[MIMEText]] = ...,
|
||||
attachments: Optional[
|
||||
Union[List[MIMEText], List[Tuple[str, str]]]
|
||||
] = ...,
|
||||
headers: Optional[Dict[str, str]] = ...,
|
||||
cc: Optional[List[str]] = ...,
|
||||
reply_to: Optional[List[str]] = ...,
|
||||
cc: Optional[Union[str, List[str], Tuple[str, str]]] = ...,
|
||||
reply_to: Optional[Union[str, List[Union[str, None]]]] = ...,
|
||||
) -> None: ...
|
||||
def get_connection(self, fail_silently: bool = ...) -> BaseEmailBackend: ...
|
||||
def message(self) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
|
||||
def message(self) -> MIMEMixin: ...
|
||||
def recipients(self) -> List[str]: ...
|
||||
def send(self, fail_silently: bool = ...) -> int: ...
|
||||
def attach(
|
||||
self, filename: str = ..., content: bytes = ..., mimetype: Optional[str] = ...
|
||||
self,
|
||||
filename: Optional[Union[str, MIMEText]] = ...,
|
||||
content: Optional[Union[bytes, str, SafeMIMEText, EmailMessage]] = ...,
|
||||
mimetype: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def attach_file(self, path: str, mimetype: Optional[str] = ...) -> None: ...
|
||||
def _create_message(
|
||||
self, msg: SafeMIMEText
|
||||
) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
|
||||
def _create_attachments(
|
||||
self, msg: Union[SafeMIMEMultipart, SafeMIMEText]
|
||||
) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
|
||||
def _create_mime_attachment(
|
||||
self, content: Union[str, bytes], mimetype: str
|
||||
) -> MIMEBase: ...
|
||||
def _create_attachment(
|
||||
self,
|
||||
filename: Optional[str],
|
||||
content: Union[bytes, str, SafeMIMEText],
|
||||
mimetype: str = ...,
|
||||
) -> MIMEBase: ...
|
||||
def _set_list_header_if_not_empty(
|
||||
self, msg: Union[SafeMIMEMultipart, SafeMIMEText], header: str, values: List[str]
|
||||
) -> None: ...
|
||||
|
||||
class EmailMultiAlternatives(EmailMessage):
|
||||
attachments: List[Any]
|
||||
bcc: List[Any]
|
||||
body: django.utils.safestring.SafeText
|
||||
cc: List[Any]
|
||||
connection: None
|
||||
extra_headers: Dict[Any, Any]
|
||||
from_email: str
|
||||
reply_to: List[Any]
|
||||
subject: str
|
||||
to: List[str]
|
||||
alternative_subtype: str = ...
|
||||
alternatives: Any = ...
|
||||
def __init__(
|
||||
@@ -111,19 +120,13 @@ class EmailMultiAlternatives(EmailMessage):
|
||||
subject: str = ...,
|
||||
body: str = ...,
|
||||
from_email: Optional[str] = ...,
|
||||
to: List[str] = ...,
|
||||
bcc: None = ...,
|
||||
to: Optional[List[str]] = ...,
|
||||
bcc: Optional[List[str]] = ...,
|
||||
connection: Optional[BaseEmailBackend] = ...,
|
||||
attachments: None = ...,
|
||||
headers: Optional[Dict[str, str]] = ...,
|
||||
alternatives: None = ...,
|
||||
alternatives: Optional[List[Tuple[str, str]]] = ...,
|
||||
cc: None = ...,
|
||||
reply_to: None = ...,
|
||||
) -> None: ...
|
||||
def attach_alternative(self, content: str, mimetype: str) -> None: ...
|
||||
def _create_message(
|
||||
self, msg: SafeMIMEText
|
||||
) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
|
||||
def _create_alternatives(
|
||||
self, msg: SafeMIMEText
|
||||
) -> Union[SafeMIMEMultipart, SafeMIMEText]: ...
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
# Stubs for django.core.mail.utils (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Any
|
||||
|
||||
class CachedDnsName:
|
||||
def __str__(self) -> str: ...
|
||||
_fqdn: Any = ...
|
||||
def get_fqdn(self) -> str: ...
|
||||
|
||||
DNS_NAME: Any
|
||||
|
||||
Reference in New Issue
Block a user