server.pyi 669 B

1234567891011121314151617181920212223
  1. from typing import Callable, Optional
  2. from twisted.web import http
  3. from twisted.web.resource import IResource
  4. class Request(http.Request): ...
  5. # A requestFactory is allowed to be "[a] factory which is called with (channel)
  6. # and creates L{Request} instances.".
  7. RequestFactory = Callable[[http.HTTPChannel], Request]
  8. class Site(http.HTTPFactory):
  9. displayTracebacks: bool
  10. def __init__(
  11. self,
  12. resource: IResource,
  13. requestFactory: Optional[RequestFactory] = ...,
  14. # Args and kwargs get passed to http.HTTPFactory. But we don't use them.
  15. *args: object,
  16. **kwargs: object,
  17. ): ...
  18. NOT_DONE_YET = object # Opaque