import abc
[docs]
class ConsoleProtocol(abc.ABC):
"""Abstract class for the ConsoleProtocol"""
[docs]
@abc.abstractmethod
def read(self):
"""
Read data from underlying port
"""
raise NotImplementedError
[docs]
@abc.abstractmethod
def write(self, data: bytes):
"""
Write data to underlying port
"""
raise NotImplementedError
[docs]
def sendline(self, line: str):
raise NotImplementedError
[docs]
def sendcontrol(self, char: str):
raise NotImplementedError
[docs]
def expect(self, pattern: str):
raise NotImplementedError
[docs]
class Client(abc.ABC):
[docs]
@abc.abstractmethod
def get_console_matches(self):
raise NotImplementedError
[docs]
@abc.abstractmethod
def notify_console_match(self, pattern, match):
raise NotImplementedError