💾 Archived View for tris.fyi › pydoc › amethyst.resource captured on 2022-07-16 at 15:02:13. 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.resource

This module has no docstring.

Classes

Context

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

FilesystemResource

do_cgi(self, ctx: amethyst.request.Context, filename: str) -> amethyst.response.Response
send_file(self, filename: str) -> amethyst.response.Response

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.

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.
    
Resource = typing.Callable[[amethyst.request.Context], typing.Awaitable[amethyst.response.Response]]
default_mime_types = {'.txt': 'text/plain', '.gmi': 'text/gemini', '.jpg': 'image/jpeg'}

Modules

asyncio

logging

os

subprocess