diff --git a/bitkeylib/transport.py b/bitkeylib/transport.py index aaf13ee..ad13c3f 100644 --- a/bitkeylib/transport.py +++ b/bitkeylib/transport.py @@ -1,25 +1,28 @@ import struct import mapping +class NotImplementedException(Exception): + pass + class Transport(object): def __init__(self, device, *args, **kwargs): self.device = device self._open() def _open(self): - raise NotImplemented + raise NotImplementedException("Not implemented") def _close(self): - raise NotImplemented + raise NotImplementedException("Not implemented") def _write(self, msg): - raise NotImplemented + raise NotImplementedException("Not implemented") def _read(self): - raise NotImplemented + raise NotImplementedException("Not implemented") def ready_to_read(self): - raise NotImplemented + raise NotImplementedException("Not implemented") def close(self): self._close() diff --git a/bitkeylib/transport_fake.py b/bitkeylib/transport_fake.py index 1954c96..a56f442 100644 --- a/bitkeylib/transport_fake.py +++ b/bitkeylib/transport_fake.py @@ -2,7 +2,7 @@ # Local serial port loopback: socat PTY,link=COM8 PTY,link=COM9 -from transport import Transport +from transport import Transport, NotImplementedException class FakeTransport(Transport): def __init__(self, device, *args, **kwargs): @@ -21,4 +21,4 @@ class FakeTransport(Transport): pass def _read(self): - raise NotImplemented \ No newline at end of file + raise NotImplementedException("Not implemented") \ No newline at end of file