apply black and isort (#4287)

* apply black and isort

* move some type ignores
This commit is contained in:
Jelle Zijlstra
2020-06-28 13:31:00 -07:00
committed by GitHub
parent fe58699ca5
commit 5d553c9584
800 changed files with 13875 additions and 10332 deletions

View File

@@ -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]: ...