Source code for tbot.machine.board.machine

# tbot, Embedded Automation Tool
# Copyright (C) 2018  Harald Seiler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

import typing
from tbot import machine
from . import board

B = typing.TypeVar("B", bound=board.Board)


[docs]class BoardMachine(machine.Machine, typing.Generic[B]): """Abstract base for board machines.""" def __init__(self, board: B) -> None: """ Create a new board machine. :param tbot.machine.board.Board board: The board this machine should use. """ super().__init__() self.board: B = board def __repr__(self) -> str: return f"{self.__class__.__name__}({self.board!r})" @property def lh(self) -> machine.linux.LabHost: """Return the lab-host of this board.""" return self.board.lh