Format: application/octet-stream
⬇ Download File (2.4 KB)
   1  import socket
   2  import ssl
   3  import sys
   4  from typing import Any, BinaryIO, Dict, List, Optional, Pattern, Text, Tuple, overload
   5  
   6  _LongResp = Tuple[bytes, List[bytes], int]
   7  
   8  class error_proto(Exception): ...
   9  
  10  POP3_PORT: int
  11  POP3_SSL_PORT: int
  12  CR: bytes
  13  LF: bytes
  14  CRLF: bytes
  15  
  16  class POP3:
  17      if sys.version_info >= (3, 0):
  18          encoding: Text
  19  
  20      host: Text
  21      port: int
  22      sock: socket.socket
  23      file: BinaryIO
  24      welcome: bytes
  25      def __init__(self, host: Text, port: int = ..., timeout: float = ...) -> None: ...
  26      def getwelcome(self) -> bytes: ...
  27      def set_debuglevel(self, level: int) -> None: ...
  28      def user(self, user: Text) -> bytes: ...
  29      def pass_(self, pswd: Text) -> bytes: ...
  30      def stat(self) -> Tuple[int, int]: ...
  31      def list(self, which: Optional[Any] = ...) -> _LongResp: ...
  32      def retr(self, which: Any) -> _LongResp: ...
  33      def dele(self, which: Any) -> bytes: ...
  34      def noop(self) -> bytes: ...
  35      def rset(self) -> bytes: ...
  36      def quit(self) -> bytes: ...
  37      def close(self) -> None: ...
  38      def rpop(self, user: Text) -> bytes: ...
  39      timestamp: Pattern[Text]
  40  
  41      if sys.version_info < (3, 0):
  42          def apop(self, user: Text, secret: Text) -> bytes: ...
  43      else:
  44          def apop(self, user: Text, password: Text) -> bytes: ...
  45      def top(self, which: Any, howmuch: int) -> _LongResp: ...
  46      @overload
  47      def uidl(self) -> _LongResp: ...
  48      @overload
  49      def uidl(self, which: Any) -> bytes: ...
  50      if sys.version_info >= (3, 5):
  51          def utf8(self) -> bytes: ...
  52      if sys.version_info >= (3, 4):
  53          def capa(self) -> Dict[Text, List[Text]]: ...
  54          def stls(self, context: Optional[ssl.SSLContext] = ...) -> bytes: ...
  55  
  56  class POP3_SSL(POP3):
  57      if sys.version_info >= (3, 0):
  58          def __init__(
  59              self,
  60              host: Text,
  61              port: int = ...,
  62              keyfile: Optional[Text] = ...,
  63              certfile: Optional[Text] = ...,
  64              timeout: float = ...,
  65              context: Optional[ssl.SSLContext] = ...,
  66          ) -> None: ...
  67      else:
  68          def __init__(
  69              self, host: Text, port: int = ..., keyfile: Optional[Text] = ..., certfile: Optional[Text] = ..., timeout: float = ...
  70          ) -> None: ...
  71      if sys.version_info >= (3, 4):
  72          # "context" is actually the last argument, but that breaks LSP and it doesn't really matter because all the arguments are ignored
  73          def stls(self, context: Any = ..., keyfile: Any = ..., certfile: Any = ...) -> bytes: ...
  74