j5.backends package

Submodules

j5.backends.base module

The base classes for backends.

class j5.backends.base.Backend[source]

Bases: object

The base class for a backend.

A backend is an implementation of a specific board for an environment.

classmethod discover() → List[Board][source]

Discover boards that this backend can control.

environment

Environment the backend belongs too.

get_firmware_version(board: Board) → Optional[str][source]

Get the firmware version of the board.

class j5.backends.base.BackendMeta[source]

Bases: abc.ABCMeta

The metaclass for a backend.

Responsible for registering the board-backend mapping with an Environment.

exception j5.backends.base.CommunicationError[source]

Bases: Exception

A communication error occurred.

This error is thrown when there is an error communicating with a board, if a more specific exception is available, then that may be thrown instead, but it should inherit from this one.

class j5.backends.base.Environment(name: str)[source]

Bases: object

A collection of board implementations that can work together.

Auto-populated with board mappings using metaclass magic.

get_backend(board: Type[Board]) → Type[j5.backends.base.Backend][source]

Get the backend for a board.

register_backend(board: Type[Board], backend: Type[j5.backends.base.Backend]) → None[source]

Register a new backend with this Backend Group.

supported_boards

The boards that are supported by this backend group.

Module contents

Backend classes.

class j5.backends.Backend[source]

Bases: object

The base class for a backend.

A backend is an implementation of a specific board for an environment.

classmethod discover() → List[Board][source]

Discover boards that this backend can control.

environment

Environment the backend belongs too.

get_firmware_version(board: Board) → Optional[str][source]

Get the firmware version of the board.

exception j5.backends.CommunicationError[source]

Bases: Exception

A communication error occurred.

This error is thrown when there is an error communicating with a board, if a more specific exception is available, then that may be thrown instead, but it should inherit from this one.

class j5.backends.Environment(name: str)[source]

Bases: object

A collection of board implementations that can work together.

Auto-populated with board mappings using metaclass magic.

get_backend(board: Type[Board]) → Type[j5.backends.base.Backend][source]

Get the backend for a board.

register_backend(board: Type[Board], backend: Type[j5.backends.base.Backend]) → None[source]

Register a new backend with this Backend Group.

supported_boards

The boards that are supported by this backend group.