From fee1e21085e1176b4032a299f5ddf6a91b5af75c Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 24 Jul 2020 14:25:27 -0500 Subject: Fix package imports and add command failure error --- lirc/__init__.py | 8 +++++--- lirc/exceptions.py | 14 +++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lirc/__init__.py b/lirc/__init__.py index fe8e829..6b2338d 100644 --- a/lirc/__init__.py +++ b/lirc/__init__.py @@ -1,11 +1,12 @@ -from .exceptions import ( +from lirc.exceptions import ( InvalidReplyPacketFormatError, + LircCommandFailureError, LircError, LircSocketError, LircSocketTimeoutError, ) -from .lirc import Lirc -from .response import LircResponse +from lirc.lirc import Lirc +from lirc.lirc_response import LircResponse __version__ = "0.1.0" @@ -16,4 +17,5 @@ __all__ = [ "LircSocketError", "LircSocketTimeoutError", "InvalidReplyPacketFormatError", + "LircCommandFailureError", ] diff --git a/lirc/exceptions.py b/lirc/exceptions.py index 063ca27..314cf17 100644 --- a/lirc/exceptions.py +++ b/lirc/exceptions.py @@ -1,5 +1,10 @@ class LircError(Exception): - """A generic error that comes from this package.""" + """ + A generic error that comes from this package. + + All errors are subclasses of this error so you + could catch all lirc errors by catching this one. + """ class InvalidReplyPacketFormatError(LircError): @@ -16,3 +21,10 @@ class LircSocketTimeoutError(LircSocketError): This can happen when recv does not find any data for a given amount of time. """ + + +class LircCommandFailureError(LircError): + """ + For when we send a command to the LIRC server + and that command fails to send, for whatever reason. + """ -- cgit v1.2.3