aio-libs / aiohttp
1 10
import http.server
2 10
import sys
3 10
from typing import Mapping, Tuple
4

5 10
from . import __version__
6 10
from .http_exceptions import HttpProcessingError as HttpProcessingError
7 10
from .http_parser import (
8
    HeadersParser as HeadersParser,
9
    HttpParser as HttpParser,
10
    HttpRequestParser as HttpRequestParser,
11
    HttpResponseParser as HttpResponseParser,
12
    RawRequestMessage as RawRequestMessage,
13
    RawResponseMessage as RawResponseMessage,
14
)
15 10
from .http_websocket import (
16
    WS_CLOSED_MESSAGE as WS_CLOSED_MESSAGE,
17
    WS_CLOSING_MESSAGE as WS_CLOSING_MESSAGE,
18
    WS_KEY as WS_KEY,
19
    WebSocketError as WebSocketError,
20
    WebSocketReader as WebSocketReader,
21
    WebSocketWriter as WebSocketWriter,
22
    WSCloseCode as WSCloseCode,
23
    WSMessage as WSMessage,
24
    WSMsgType as WSMsgType,
25
    ws_ext_gen as ws_ext_gen,
26
    ws_ext_parse as ws_ext_parse,
27
)
28 10
from .http_writer import (
29
    HttpVersion as HttpVersion,
30
    HttpVersion10 as HttpVersion10,
31
    HttpVersion11 as HttpVersion11,
32
    StreamWriter as StreamWriter,
33
)
34

35 10
__all__ = (
36
    "HttpProcessingError",
37
    "RESPONSES",
38
    "SERVER_SOFTWARE",
39
    # .http_writer
40
    "StreamWriter",
41
    "HttpVersion",
42
    "HttpVersion10",
43
    "HttpVersion11",
44
    # .http_parser
45
    "HeadersParser",
46
    "HttpParser",
47
    "HttpRequestParser",
48
    "HttpResponseParser",
49
    "RawRequestMessage",
50
    "RawResponseMessage",
51
    # .http_websocket
52
    "WS_CLOSED_MESSAGE",
53
    "WS_CLOSING_MESSAGE",
54
    "WS_KEY",
55
    "WebSocketReader",
56
    "WebSocketWriter",
57
    "ws_ext_gen",
58
    "ws_ext_parse",
59
    "WSMessage",
60
    "WebSocketError",
61
    "WSMsgType",
62
    "WSCloseCode",
63
)
64

65

66 10
SERVER_SOFTWARE = "Python/{0[0]}.{0[1]} aiohttp/{1}".format(
67
    sys.version_info, __version__
68
)  # type: str
69

70 10
RESPONSES = (
71
    http.server.BaseHTTPRequestHandler.responses
72
)  # type: Mapping[int, Tuple[str, str]]

Read our documentation on viewing source code .

Loading