flexpass.BackendDefinition

class flexpass.BackendDefinition(*, backend_cls: type[Backend], name: str, priority: int, readonly: bool, **options)

Bases: object

Definition of a backend, used particularly before the backend instanciation.

__init__(*, backend_cls: type[Backend], name: str, priority: int, readonly: bool, **options)

Methods

__init__(*, backend_cls, name, priority, ...)

get_instance()

Return the instanciated backend.

Attributes

backend_cls

Class of the backend.

name

Name of the backend.

priority

Priority of the backend.

readonly

Indicate whether the backend is read-only.

options

Options to pass to the backend.

instance

The actual backend if it was successfully instanciated.

exception

The exception raised in case of error during backend instanciation.

backend_cls: type[Backend]

Class of the backend.

exception: Exception

The exception raised in case of error during backend instanciation.

get_instance() Backend

Return the instanciated backend. Raise an exception in case of error during backend instanciation.

instance: Backend

The actual backend if it was successfully instanciated.

name: str

Name of the backend.

options: dict[str, Any]

Options to pass to the backend.

priority: int

Priority of the backend.

readonly: bool

Indicate whether the backend is read-only.