From 79fd7d84fe8acbc03b857c4ff483db9c16a0c5b1 Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Fri, 8 May 2020 14:15:37 +0200 Subject: [PATCH] Improved documentation --- doc/source/doc.rst | 4 ++-- musicpd.py | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/source/doc.rst b/doc/source/doc.rst index f0205c5..60ae4fa 100644 --- a/doc/source/doc.rst +++ b/doc/source/doc.rst @@ -1,10 +1,10 @@ MPD client class ================= +.. autodata:: musicpd.CONNECTION_TIMEOUT + .. autoclass:: musicpd.MPDClient :members: - :noindex: - .. vim: spell spelllang=en diff --git a/musicpd.py b/musicpd.py index 58edf56..8c5bfc3 100644 --- a/musicpd.py +++ b/musicpd.py @@ -30,7 +30,8 @@ ERROR_PREFIX = "ACK " SUCCESS = "OK" NEXT = "list_OK" VERSION = '0.4.5' -CONNECTION_TIMEOUT = 5 # seconds before a tcp connection attempt times out +#: seconds before a tcp connection attempt times out +CONNECTION_TIMEOUT = 5 def iterator_wrapper(func): @@ -134,7 +135,11 @@ class MPDClient: True >>> cli.host == environ['MPD_HOST'].split('@')[1] True - >>> # cli.connect() will use host/port as set in MPD_HOST/MPD_PORT + >>> cli.connect() # will use host/port as set in MPD_HOST/MPD_PORT + + :ivar str host: host used with the current connection + :ivar str,int port: port used with the current connection + :ivar str pwd: password detected in ``MPD_HOST`` environment variable .. warning:: Instance attribute host/port/pwd -- 2.39.2