You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

4 years ago
  1. import http.server
  2. import sys
  3. from typing import Mapping, Tuple # noqa
  4. from . import __version__
  5. from .http_exceptions import HttpProcessingError
  6. from .http_parser import (
  7. HeadersParser,
  8. HttpParser,
  9. HttpRequestParser,
  10. HttpResponseParser,
  11. RawRequestMessage,
  12. RawResponseMessage,
  13. )
  14. from .http_websocket import (
  15. WS_CLOSED_MESSAGE,
  16. WS_CLOSING_MESSAGE,
  17. WS_KEY,
  18. WebSocketError,
  19. WebSocketReader,
  20. WebSocketWriter,
  21. WSCloseCode,
  22. WSMessage,
  23. WSMsgType,
  24. ws_ext_gen,
  25. ws_ext_parse,
  26. )
  27. from .http_writer import (
  28. HttpVersion,
  29. HttpVersion10,
  30. HttpVersion11,
  31. StreamWriter,
  32. )
  33. __all__ = (
  34. 'HttpProcessingError', 'RESPONSES', 'SERVER_SOFTWARE',
  35. # .http_writer
  36. 'StreamWriter', 'HttpVersion', 'HttpVersion10', 'HttpVersion11',
  37. # .http_parser
  38. 'HeadersParser', 'HttpParser',
  39. 'HttpRequestParser', 'HttpResponseParser',
  40. 'RawRequestMessage', 'RawResponseMessage',
  41. # .http_websocket
  42. 'WS_CLOSED_MESSAGE', 'WS_CLOSING_MESSAGE', 'WS_KEY',
  43. 'WebSocketReader', 'WebSocketWriter', 'ws_ext_gen', 'ws_ext_parse',
  44. 'WSMessage', 'WebSocketError', 'WSMsgType', 'WSCloseCode',
  45. )
  46. SERVER_SOFTWARE = 'Python/{0[0]}.{0[1]} aiohttp/{1}'.format(
  47. sys.version_info, __version__) # type: str
  48. RESPONSES = http.server.BaseHTTPRequestHandler.responses # type: Mapping[int, Tuple[str, str]] # noqa