Skip to content

typing¤

Custom type annotations.

LibType module-attribute ¤

LibType = Literal[
    "cdll",
    "windll",
    "oledll",
    "net",
    "clr",
    "java",
    "com",
    "activex",
]

Supported library types.

PathLike module-attribute ¤

PathLike = Union[
    str, bytes, os.PathLike[str], os.PathLike[bytes]
]

Server32Subclass ¤

Server32Subclass(host, port, **kwargs)

Bases: Protocol

A subclass of Server32.

Source code in src/msl/loadlib/typing.py
25
26
def __init__(self, host: str | None, port: int, **kwargs: str) -> None:
    """Base class for loading a 32-bit library in 32-bit Python."""

path instance-attribute ¤

path

str — The path to the library file.

socket instance-attribute ¤

socket

socket — The socket instance.

serve_forever ¤

serve_forever()

Handle one request at a time until shutdown.

Source code in src/msl/loadlib/typing.py
28
29
def serve_forever(self) -> None:
    """Handle one request at a time until [shutdown][msl.loadlib.typing.Server32Subclass.shutdown]."""

server_activate ¤

server_activate()

Called by constructor to activate the server.

Source code in src/msl/loadlib/typing.py
31
32
def server_activate(self) -> None:
    """Called by constructor to activate the server."""

server_bind ¤

server_bind()

Called by constructor to bind the socket.

Source code in src/msl/loadlib/typing.py
34
35
def server_bind(self) -> None:
    """Called by constructor to bind the socket."""

server_close ¤

server_close()

Called to clean-up the server.

Source code in src/msl/loadlib/typing.py
37
38
def server_close(self) -> None:
    """Called to clean-up the server."""

shutdown ¤

shutdown()

Stops the serve_forever loop.

Source code in src/msl/loadlib/typing.py
40
41
def shutdown(self) -> None:
    """Stops the [serve_forever][msl.loadlib.typing.Server32Subclass.serve_forever] loop."""

shutdown_handler ¤

shutdown_handler()

Called just before the server shuts down.

Source code in src/msl/loadlib/typing.py
43
44
def shutdown_handler(self) -> None:
    """Called just before the server shuts down."""