mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-04 22:31:26 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
# Stubs for smtpd (Python 2 and 3)
|
||||
import sys
|
||||
import socket
|
||||
import asyncore
|
||||
import asynchat
|
||||
|
||||
import asyncore
|
||||
import socket
|
||||
import sys
|
||||
from typing import Any, DefaultDict, List, Optional, Text, Tuple, Type
|
||||
|
||||
_Address = Tuple[str, int] # (host, port)
|
||||
|
||||
|
||||
class SMTPChannel(asynchat.async_chat):
|
||||
COMMAND: int
|
||||
DATA: int
|
||||
@@ -31,13 +29,19 @@ class SMTPChannel(asynchat.async_chat):
|
||||
data_size_limit: int
|
||||
|
||||
enable_SMTPUTF8: bool
|
||||
|
||||
@property
|
||||
def max_command_size_limit(self) -> int: ...
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ...,
|
||||
map: Optional[asyncore._maptype] = ..., enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
server: SMTPServer,
|
||||
conn: socket.socket,
|
||||
addr: Any,
|
||||
data_size_limit: int = ...,
|
||||
map: Optional[asyncore._maptype] = ...,
|
||||
enable_SMTPUTF8: bool = ...,
|
||||
decode_data: bool = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ...) -> None: ...
|
||||
# base asynchat.async_chat.push() accepts bytes
|
||||
@@ -64,12 +68,17 @@ class SMTPServer(asyncore.dispatcher):
|
||||
enable_SMTPUTF8: bool
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
def __init__(self, localaddr: _Address, remoteaddr: _Address,
|
||||
data_size_limit: int = ..., map: Optional[asyncore._maptype] = ...,
|
||||
enable_SMTPUTF8: bool = ..., decode_data: bool = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
localaddr: _Address,
|
||||
remoteaddr: _Address,
|
||||
data_size_limit: int = ...,
|
||||
map: Optional[asyncore._maptype] = ...,
|
||||
enable_SMTPUTF8: bool = ...,
|
||||
decode_data: bool = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, localaddr: _Address, remoteaddr: _Address,
|
||||
data_size_limit: int = ...) -> None: ...
|
||||
def __init__(self, localaddr: _Address, remoteaddr: _Address, data_size_limit: int = ...) -> None: ...
|
||||
def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ...
|
||||
def process_message(self, peer: _Address, mailfrom: str, rcpttos: List[Text], data: str, **kwargs: Any) -> Optional[str]: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user