diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2021-04-18 18:26:39 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2021-04-18 18:26:39 -0500 |
| commit | 5e30f09c34a8d0cfaff105eb637ddf20413bd165 (patch) | |
| tree | 5650c2fe4f7c6e8bce54a10fa5da37affa1625a7 | |
| parent | Fix default Darwin connection path (diff) | |
| download | lirc-5e30f09c34a8d0cfaff105eb637ddf20413bd165.zip | |
Clean up some docstrings
| -rw-r--r-- | lirc/client.py | 22 | ||||
| -rw-r--r-- | lirc/connection/lircd_connection.py | 24 |
2 files changed, 21 insertions, 25 deletions
diff --git a/lirc/client.py b/lirc/client.py index bbdf1bd..84b98c9 100644 --- a/lirc/client.py +++ b/lirc/client.py @@ -109,9 +109,9 @@ class Client: Send an lircd SEND_STOP command. The remote and key default to the remote and key - last used with send_start if they are not specified, - since the most likely use case is sending a send_start - and then a send_stop. + last used with ``send_start`` if they are not specified, + since the most likely use case is sending a ``send_start`` + and then a ``send_stop``. Args: remote: The remote to stop. @@ -131,7 +131,7 @@ class Client: def list_remotes(self) -> List[str]: """ List all the remotes that lirc has in - its `lircd.conf.d` folder. + its ``/etc/lirc/lircd.conf.d`` folder. Raises: LircdCommandFailure: If the command fails. @@ -211,19 +211,19 @@ class Client: """ Simulate an IR event. - The --allow-simulate command line option to `lircd` must be active for this + The ``--allow-simulate`` command line option to lircd must be active for this command not to fail. - Example Format: + Lircd Format: <code> <repeat count> <button name> <remote control name> - Such as: + Example: 0000000000f40bf0 00 KEY_UP ANIMAX Args: remote: The remote to simulate key presses from. key: The key on the remote to simulate. - repeat_count: The number of times to simulate the key press. + repeat_count: The number of times to repeat the simulated key press. keycode: lircd(8) describes this option as a 16 hexadecimal digit number encoding of the IR signal. However, it says it is depreciated and should be ignored. @@ -242,11 +242,11 @@ class Client: Example: import lirc - c = lirc.Client() + client = lirc.Client() - c.set_transmitters(1) + client.set_transmitters(1) - c.set_transmitters([1,3,5]) + client.set_transmitters([1,3,5]) Args: transmitters: The transmitters to set active. diff --git a/lirc/connection/lircd_connection.py b/lirc/connection/lircd_connection.py index 6d6a662..30be4b8 100644 --- a/lirc/connection/lircd_connection.py +++ b/lirc/connection/lircd_connection.py @@ -21,24 +21,20 @@ class LircdConnection(AbstractConnection): Args: address: The address to the socket. Defaults to different - values depending on the host operating system. - - Linux: "/var/run/lirc/lircd" - Windows: ("localhost", 8765) - Darwin: "/opt/run/var/run/lirc/lircd" + values depending on the host operating system. On Linux, + it defaults to ``/var/run/lirc/lircd``. On Windows, a tuple + of ``("localhost", 8765)``. And on Darwin (macOS), + ``/opt/local/var/run/lirc/lircd``. socket: The socket to use to connect to lircd. The default - socket is determined using the host operating system. - - For Linux and Darwin, a unix domain socket connection is - used i.e. socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - - However on Windows, a TCP socket is used. i.e. socket.socket( - socket.AF_INET, socket.SOCK_STREAM - ) + socket is determined using the host operating system. For + Linux and Darwin, a unix domain socket connection is used + i.e. ``socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)``. + However on Windows, a TCP socket is used + i.e. ``socket.socket(socket.AF_INET, socket.SOCK_STREAM)``. timeout: The amount of time to wait for data from the socket before - we timeout. + we timeout. """ default = DefaultConnection() |