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
6 from .headers import Headers
\r
7 from .types import WSGIApplication, WSGIEnvironment, StartResponse, InputStream, ErrorStream
\r
8 from .util import FileWrapper, guess_scheme
\r
10 _exc_info = Tuple[Optional[Type[BaseException]],
\r
11 Optional[BaseException],
\r
12 Optional[TracebackType]]
\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
19 wsgi_version: Tuple[int, int] # undocumented
\r
20 wsgi_multithread: bool
\r
21 wsgi_multiprocess: bool
\r
26 server_software: Optional[str]
\r
28 os_environ: MutableMapping[str, str]
\r
30 wsgi_file_wrapper: Optional[Type[FileWrapper]]
\r
31 headers_class: Type[Headers] # undocumented
\r
33 traceback_limit: Optional[int]
\r
35 error_headers: List[Tuple[Text, Text]]
\r
38 def run(self, application: WSGIApplication) -> None: ...
\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
59 def _write(self, data: bytes) -> None: ...
\r
61 def _flush(self) -> None: ...
\r
63 def get_stdin(self) -> InputStream: ...
\r
65 def get_stderr(self) -> ErrorStream: ...
\r
67 def add_cgi_vars(self) -> None: ...
\r
69 class SimpleHandler(BaseHandler):
\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
81 class BaseCGIHandler(SimpleHandler): ...
\r
83 class CGIHandler(BaseCGIHandler):
\r
84 def __init__(self) -> None: ...
\r
86 class IISCGIHandler(BaseCGIHandler):
\r
87 def __init__(self) -> None: ...
\r