massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2and3 / wsgiref / handlers.pyi
1 import sys\r
2 from abc import abstractmethod\r
3 from types import TracebackType\r
4 from typing import Optional, Dict, MutableMapping, Type, Text, Callable, List, Tuple, IO\r
5 \r
6 from .headers import Headers\r
7 from .types import WSGIApplication, WSGIEnvironment, StartResponse, InputStream, ErrorStream\r
8 from .util import FileWrapper, guess_scheme\r
9 \r
10 _exc_info = Tuple[Optional[Type[BaseException]],\r
11                   Optional[BaseException],\r
12                   Optional[TracebackType]]\r
13 \r
14 def format_date_time(timestamp: Optional[float]) -> str: ...  # undocumented\r
15 if sys.version_info >= (3, 2):\r
16     def read_environ() -> Dict[str, str]: ...\r
17 \r
18 class BaseHandler:\r
19     wsgi_version: Tuple[int, int]  # undocumented\r
20     wsgi_multithread: bool\r
21     wsgi_multiprocess: bool\r
22     wsgi_run_once: bool\r
23 \r
24     origin_server: bool\r
25     http_version: str\r
26     server_software: Optional[str]\r
27 \r
28     os_environ: MutableMapping[str, str]\r
29 \r
30     wsgi_file_wrapper: Optional[Type[FileWrapper]]\r
31     headers_class: Type[Headers]  # undocumented\r
32 \r
33     traceback_limit: Optional[int]\r
34     error_status: str\r
35     error_headers: List[Tuple[Text, Text]]\r
36     error_body: bytes\r
37 \r
38     def run(self, application: WSGIApplication) -> None: ...\r
39 \r
40     def setup_environ(self) -> None: ...\r
41     def finish_response(self) -> None: ...\r
42     def get_scheme(self) -> str: ...\r
43     def set_content_length(self) -> None: ...\r
44     def cleanup_headers(self) -> None: ...\r
45     def start_response(self, status: Text, headers: List[Tuple[Text, Text]], exc_info: Optional[_exc_info] = ...) -> Callable[[bytes], None]: ...\r
46     def send_preamble(self) -> None: ...\r
47     def write(self, data: bytes) -> None: ...\r
48     def sendfile(self) -> bool: ...\r
49     def finish_content(self) -> None: ...\r
50     def close(self) -> None: ...\r
51     def send_headers(self) -> None: ...\r
52     def result_is_file(self) -> bool: ...\r
53     def client_is_modern(self) -> bool: ...\r
54     def log_exception(self, exc_info: _exc_info) -> None: ...\r
55     def handle_error(self) -> None: ...\r
56     def error_output(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ...\r
57 \r
58     @abstractmethod\r
59     def _write(self, data: bytes) -> None: ...\r
60     @abstractmethod\r
61     def _flush(self) -> None: ...\r
62     @abstractmethod\r
63     def get_stdin(self) -> InputStream: ...\r
64     @abstractmethod\r
65     def get_stderr(self) -> ErrorStream: ...\r
66     @abstractmethod\r
67     def add_cgi_vars(self) -> None: ...\r
68 \r
69 class SimpleHandler(BaseHandler):\r
70     stdin: InputStream\r
71     stdout: IO[bytes]\r
72     stderr: ErrorStream\r
73     base_env: MutableMapping[str, str]\r
74     def __init__(self, stdin: InputStream, stdout: IO[bytes], stderr: ErrorStream, environ: MutableMapping[str, str], multithread: bool = ..., multiprocess: bool = ...) -> None: ...\r
75     def get_stdin(self) -> InputStream: ...\r
76     def get_stderr(self) -> ErrorStream: ...\r
77     def add_cgi_vars(self) -> None: ...\r
78     def _write(self, data: bytes) -> None: ...\r
79     def _flush(self) -> None: ...\r
80 \r
81 class BaseCGIHandler(SimpleHandler): ...\r
82 \r
83 class CGIHandler(BaseCGIHandler):\r
84     def __init__(self) -> None: ...\r
85 \r
86 class IISCGIHandler(BaseCGIHandler):\r
87     def __init__(self) -> None: ...\r