jmri_openlcb.transport.port

 1from __future__ import annotations
 2
 3from abc import ABC, abstractmethod
 4
 5
 6class BytePort(ABC):
 7    @abstractmethod
 8    async def write(self, data: bytes) -> None: ...
 9    @abstractmethod
10    async def read_byte(self) -> int: ...
11    @abstractmethod
12    async def aclose(self) -> None: ...
13    @property
14    @abstractmethod
15    def is_open(self) -> bool: ...
class BytePort(abc.ABC):
 7class BytePort(ABC):
 8    @abstractmethod
 9    async def write(self, data: bytes) -> None: ...
10    @abstractmethod
11    async def read_byte(self) -> int: ...
12    @abstractmethod
13    async def aclose(self) -> None: ...
14    @property
15    @abstractmethod
16    def is_open(self) -> bool: ...

Helper class that provides a standard way to create an ABC using inheritance.

@abstractmethod
async def write(self, data: bytes) -> None:
8    @abstractmethod
9    async def write(self, data: bytes) -> None: ...
@abstractmethod
async def read_byte(self) -> int:
10    @abstractmethod
11    async def read_byte(self) -> int: ...
@abstractmethod
async def aclose(self) -> None:
12    @abstractmethod
13    async def aclose(self) -> None: ...
is_open: bool
14    @property
15    @abstractmethod
16    def is_open(self) -> bool: ...