j5.backends package

Submodules

j5.backends.backend module

The base classes for backends.

class j5.backends.backend.Backend[source]

Bases: object

The base class for a backend.

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

It can hold data about the actual board it is controlling. There should be a ratio of one instance of a Backend to one instance of a Board. The Backend object should not hold any references to the Board, instead having it’s methods executed by the code for the individual Board.

A Backend usually also implements a number of ComponentInterfaces which thus allow a physical component to be controlled by the abstract Component representation.

board

Type of board this backend implements.

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

Discover boards that this backend can control.

environment

Environment the backend belongs too.

firmware_version

The firmware version of the board.

class j5.backends.backend.BackendMeta[source]

Bases: abc.ABCMeta

The metaclass for a backend.

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

exception j5.backends.backend.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.backend.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.backend.Backend][source]

Get the backend for a board.

register_backend(board: Type[Board], backend: Type[j5.backends.backend.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.

It can hold data about the actual board it is controlling. There should be a ratio of one instance of a Backend to one instance of a Board. The Backend object should not hold any references to the Board, instead having it’s methods executed by the code for the individual Board.

A Backend usually also implements a number of ComponentInterfaces which thus allow a physical component to be controlled by the abstract Component representation.

board

Type of board this backend implements.

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

Discover boards that this backend can control.

environment

Environment the backend belongs too.

firmware_version

The firmware version of the board.

class j5.backends.BackendMeta[source]

Bases: abc.ABCMeta

The metaclass for a backend.

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

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.backend.Backend][source]

Get the backend for a board.

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

Register a new backend with this Backend Group.

supported_boards

The boards that are supported by this backend group.