💾 Archived View for tris.fyi › pydoc › amethyst.handler captured on 2022-07-16 at 15:02:06. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-04-28)

➡️ Next capture (2023-01-29)

🚧 View Differences

-=-=-=-=-=-=-

Back to module index

Go to module by name

amethyst

amethyst.handler

This module has no docstring.

Classes

Connection

Connection(server: amethyst.server.Server, peer_addr: str, peer_cert: Optional[bytes] = None)
peer_cert = None

Context

Context(host: str, orig_path: str, path: str, query: Optional[str], conn: amethyst.request.Connection, data: Dict[str, Any] = <factory>)

GenericHandler

Response

Response(status_code: amethyst.response.Status, meta: str, content: Optional[bytes] = None)
content = None

Status

An enumeration.
BAD_REQUEST = <Status.BAD_REQUEST: 59>
CERTIFICATE_NOT_AUTHORIZED = <Status.CERTIFICATE_NOT_AUTHORIZED: 61>
CERTIFICATE_NOT_VALID = <Status.CERTIFICATE_NOT_VALID: 62>
CGI_ERROR = <Status.CGI_ERROR: 42>
CLIENT_CERTIFICATE_REQUIRED = <Status.CLIENT_CERTIFICATE_REQUIRED: 60>
GONE = <Status.GONE: 52>
INPUT = <Status.INPUT: 10>
NOT_FOUND = <Status.NOT_FOUND: 51>
PERMANENT_FAILURE = <Status.PERMANENT_FAILURE: 50>
PROXY_ERROR = <Status.PROXY_ERROR: 43>
PROXY_REQUEST_REFUSED = <Status.PROXY_REQUEST_REFUSED: 53>
REDIRECT_PERMANENT = <Status.REDIRECT_PERMANENT: 31>
REDIRECT_TEMPORARY = <Status.REDIRECT_TEMPORARY: 30>
SENSITIVE_INPUT = <Status.SENSITIVE_INPUT: 11>
SERVER_UNAVAILABLE = <Status.SERVER_UNAVAILABLE: 41>
SLOW_DOWN = <Status.SLOW_DOWN: 44>
SUCCESS = <Status.SUCCESS: 20>
TEMPORARY_FAILURE = <Status.TEMPORARY_FAILURE: 40>
name = <types.DynamicClassAttribute object at 0x7f92bfb87af0>
  The name of the Enum member.
value = <types.DynamicClassAttribute object at 0x7f92bfb87b20>
  The value of the Enum member.

Functions

get_path_components

get_path_components(path)

urlparse

urlparse(url, scheme='', allow_fragments=True)

  Parse a URL into 6 components:
      <scheme>://<netloc>/<path>;<params>?<query>#<fragment>

      The result is a named 6-tuple with fields corresponding to the
      above. It is either a ParseResult or ParseResultBytes object,
      depending on the type of the url parameter.

      The username, password, hostname, and port sub-components of netloc
      can also be accessed as attributes of the returned object.

      The scheme argument provides the default value of the scheme
      component when no scheme is found in url.

      If allow_fragments is False, no attempt is made to separate the
      fragment component from the previous component, which can be either
      path or query.

      Note that % escapes are not expanded.
    

Other members

Awaitable = typing.Awaitable
  A generic version of collections.abc.Awaitable.
Callable = typing.Callable
  Callable type; Callable[[int], str] is a function of (int) -> str.

      The subscription syntax must always be used with exactly two
      values: the argument list and the return type.  The argument list
      must be a list of types or ellipsis; the return type must be a single type.

      There is no syntax to indicate optional or keyword arguments,
      such function types are rarely used as callback types.
    
Dict = typing.Dict
  A generic version of dict.
Handler = typing.Callable[[str, amethyst.request.Connection], typing.Awaitable[amethyst.response.Response]]
PORT_RE = re.compile(':([0-9]{1,5})


)
Resource = typing.Callable[[amethyst.request.Context], typing.Awaitable[amethyst.response.Response]]

Modules

logging

re