diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-24 14:25:27 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-07-24 14:25:27 -0500 |
| commit | fee1e21085e1176b4032a299f5ddf6a91b5af75c (patch) | |
| tree | bd07bb8b13e476e0a3ebe104dadbcbb30c78875c | |
| parent | Expand on Usage section in readme (diff) | |
| download | lirc-fee1e21085e1176b4032a299f5ddf6a91b5af75c.zip | |
Fix package imports and add command failure error
| -rw-r--r-- | lirc/__init__.py | 8 | ||||
| -rw-r--r-- | 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. + """ |