From cd10c63272151a8cab942cf21ad63668cf17397d Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Wed, 10 Apr 2024 18:14:15 +0200 Subject: [PATCH 01/16] Add module name in logger in example --- doc/source/examples/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/examples/client.py b/doc/source/examples/client.py index 41ef1bd..3598673 100644 --- a/doc/source/examples/client.py +++ b/doc/source/examples/client.py @@ -13,7 +13,7 @@ class MyClient(musicpd.MPDClient): def __init__(self): # Set logging to debug level logging.basicConfig(level=logging.DEBUG, - format='%(levelname)-8s %(message)s') + format='%(levelname)-8s %(module)-8s %(message)s') self.log = logging.getLogger(__name__) super().__init__() # Set host/port/password after init to overrides defaults -- 2.39.5 From 1755eee900ee766c8e3f5224419605b4b0f27bc5 Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Thu, 11 Apr 2024 19:12:16 +0200 Subject: [PATCH 02/16] Improved/fixed pyproject --- MANIFEST.in | 3 ++- pyproject.toml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index fd43aca..8f82cfa 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include CHANGES.txt -recursive-include doc/source * +graft doc/source +global-exclude *~ *.py[cod] *.so diff --git a/pyproject.toml b/pyproject.toml index 971c94b..a3f46bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,5 +30,8 @@ sphinx = ["Sphinx>=5.3.0"] [build-system] requires = ["setuptools>=61.0.0"] +[tool.setuptools] +py-modules = ["musicpd"] + [tool.setuptools.dynamic] version = {attr = "musicpd.VERSION"} -- 2.39.5 From 06eafbe03574c0797f014def1fe4f6afb1df3f87 Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Fri, 12 Apr 2024 19:22:07 +0200 Subject: [PATCH 03/16] ci: Intercept pyproject changes --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d55875f..6576783 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,6 +97,8 @@ build: - .gitlab-ci.yml - musicpd.py - test.py + - MANIFEST.in + - pyproject.toml - if: $CI_PIPELINE_SOURCE == "schedule" tag_release: -- 2.39.5 From 1d10477733e0c6dfe0137b71203f3f094034bcd0 Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Wed, 10 Apr 2024 18:14:21 +0200 Subject: [PATCH 04/16] Releasing 0.9.0 --- musicpd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/musicpd.py b/musicpd.py index 10bcdc4..e24b51d 100644 --- a/musicpd.py +++ b/musicpd.py @@ -19,7 +19,7 @@ ERROR_PREFIX = "ACK " SUCCESS = "OK" NEXT = "list_OK" #: Module version -VERSION = '0.9.0b2' +VERSION = '0.9.0' #: Seconds before a connection attempt times out #: (overriden by :envvar:`MPD_TIMEOUT` env. var.) CONNECTION_TIMEOUT = 30 -- 2.39.5 From c055ff596761f4800c932f61822888f1f3e189a0 Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Sat, 24 Aug 2024 19:39:16 +0200 Subject: [PATCH 05/16] Improved documentation Add supported commands returned type, generated doc from src: python3 ./doc/extract_supported_commands.py > ./doc/source/_commands.rst --- CHANGES.txt | 5 + doc/extract_supported_commands.py | 68 +++++++++++ doc/source/_commands.rst | 192 ++++++++++++++++++++++++++++++ doc/source/commands.rst | 6 +- doc/source/index.rst | 2 +- doc/source/use.rst | 4 +- musicpd.py | 28 ++--- 7 files changed, 285 insertions(+), 20 deletions(-) create mode 100644 doc/extract_supported_commands.py create mode 100644 doc/source/_commands.rst diff --git a/CHANGES.txt b/CHANGES.txt index fe285d3..449772c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,11 @@ python-musicpd Changes List =========================== +Changes in 0.9.1 +---------------- + + * Improved documentation, add supported commands rtype + Changes in 0.9.0 ---------------- diff --git a/doc/extract_supported_commands.py b/doc/extract_supported_commands.py new file mode 100644 index 0000000..afe2c4a --- /dev/null +++ b/doc/extract_supported_commands.py @@ -0,0 +1,68 @@ +#!/usr/bin/python3 +"""python3 ./doc/extract_supported_commands.py > ./doc/source/_commands.rst +""" +import pathlib +import re +import sys +sys.path.insert(0,pathlib.Path('.').absolute().as_posix()) +import musicpd + +START = 'self._commands = {' +END = '}' +LATEST_PROTOCOL = 'https://mpd.readthedocs.io/en/latest/protocol.html' +TYPE_MAPPING = { + 'fetch_nothing': 'None', + 'fetch_object': 'dict', + 'fetch_list': 'list', + 'fetch_item': 'str', + 'fetch_playlist': 'list', + 'fetch_songs': 'list[dict]', + 'fetch_changes': 'list[dict]', + 'fetch_composite': 'dict', + 'fetch_playlists': 'dict', + 'fetch_database': 'list[dict]', + 'fetch_mounts': 'list[dict]', + 'fetch_neighbors': 'list[dict]', + 'fetch_outputs': 'list[dict]', + 'fetch_plugins': 'list[dict]', + 'fetch_messages': 'list[dict]', +} + + +def find_start(fd): + line = fd.readline() + while START not in line: + line = fd.readline() + if not line: + break + if not line: + print('Reach end of file!', file=sys.stderr) + sys.exit(1) + + +def main(): + with open('musicpd.py', 'r', encoding='utf-8') as fd: + # fast forward to find self._commands + find_start(fd) + cmd_patt = '"(?P.*)":' + cmd_patt = r'"(?P.*?)": +self\._(?P.+?),' + tit_patt = '# (?P[^#]+?) ?# ?(?P<anchor>.+?)$' + cmd_regex = re.compile(cmd_patt) + tit_regex = re.compile(tit_patt) + print(f'Below the commands list last updated for v{musicpd.VERSION}.') + # Now extract supported commands + line = 'foo' + while line and END not in line: + line = fd.readline() + cmd = cmd_regex.search(line) + tit = tit_regex.search(line) + if tit: + print(f'\n{tit[1]}') + print('^'*len(tit[1])) + print(f'\nProtocol documentation: `{tit[1]} <{LATEST_PROTOCOL}#{tit[2]}>`_\n') + if cmd: + print(f'* **{cmd[1]}** -> {TYPE_MAPPING.get(cmd[2], "ukn")}') + + +if __name__ == '__main__': + main() diff --git a/doc/source/_commands.rst b/doc/source/_commands.rst new file mode 100644 index 0000000..18a7343 --- /dev/null +++ b/doc/source/_commands.rst @@ -0,0 +1,192 @@ +Below the commands list last updated for v0.9.1. + +Querying MPD’s status +^^^^^^^^^^^^^^^^^^^^^ + +Protocol documentation: `Querying MPD’s status <https://mpd.readthedocs.io/en/latest/protocol.html#querying-mpd-s-status>`_ + +* **clearerror** -> None +* **currentsong** -> dict +* **idle** -> list +* **status** -> dict +* **stats** -> dict + +Playback Option +^^^^^^^^^^^^^^^ + +Protocol documentation: `Playback Option <https://mpd.readthedocs.io/en/latest/protocol.html#playback-options>`_ + +* **consume** -> None +* **crossfade** -> None +* **mixrampdb** -> None +* **mixrampdelay** -> None +* **random** -> None +* **repeat** -> None +* **setvol** -> None +* **getvol** -> dict +* **single** -> None +* **replay_gain_mode** -> None +* **replay_gain_status** -> str +* **volume** -> None + +Controlling playback +^^^^^^^^^^^^^^^^^^^^ + +Protocol documentation: `Controlling playback <https://mpd.readthedocs.io/en/latest/protocol.html#controlling-playback>`_ + +* **next** -> None +* **pause** -> None +* **play** -> None +* **playid** -> None +* **previous** -> None +* **seek** -> None +* **seekid** -> None +* **seekcur** -> None +* **stop** -> None + +The Queue +^^^^^^^^^ + +Protocol documentation: `The Queue <https://mpd.readthedocs.io/en/latest/protocol.html#the-queue>`_ + +* **add** -> None +* **addid** -> str +* **clear** -> None +* **delete** -> None +* **deleteid** -> None +* **move** -> None +* **moveid** -> None +* **playlist** -> list +* **playlistfind** -> list[dict] +* **playlistid** -> list[dict] +* **playlistinfo** -> list[dict] +* **playlistsearch** -> list[dict] +* **plchanges** -> list[dict] +* **plchangesposid** -> list[dict] +* **prio** -> None +* **prioid** -> None +* **rangeid** -> None +* **shuffle** -> None +* **swap** -> None +* **swapid** -> None +* **addtagid** -> None +* **cleartagid** -> None + +Stored playlists +^^^^^^^^^^^^^^^^ + +Protocol documentation: `Stored playlists <https://mpd.readthedocs.io/en/latest/protocol.html#stored-playlists>`_ + +* **listplaylist** -> list +* **listplaylistinfo** -> list[dict] +* **listplaylists** -> dict +* **load** -> None +* **playlistadd** -> None +* **playlistclear** -> None +* **playlistdelete** -> None +* **playlistmove** -> None +* **rename** -> None +* **rm** -> None +* **save** -> None + +The music database +^^^^^^^^^^^^^^^^^^ + +Protocol documentation: `The music database <https://mpd.readthedocs.io/en/latest/protocol.html#the-music-database>`_ + +* **albumart** -> dict +* **count** -> dict +* **getfingerprint** -> dict +* **find** -> list[dict] +* **findadd** -> None +* **list** -> list +* **listall** -> list[dict] +* **listallinfo** -> list[dict] +* **listfiles** -> list[dict] +* **lsinfo** -> list[dict] +* **readcomments** -> dict +* **readpicture** -> dict +* **search** -> list[dict] +* **searchadd** -> None +* **searchaddpl** -> None +* **update** -> str +* **rescan** -> str + +Mounts and neighbors +^^^^^^^^^^^^^^^^^^^^ + +Protocol documentation: `Mounts and neighbors <https://mpd.readthedocs.io/en/latest/protocol.html#mounts-and-neighbors>`_ + +* **mount** -> None +* **unmount** -> None +* **listmounts** -> list[dict] +* **listneighbors** -> list[dict] + +Stickers +^^^^^^^^ + +Protocol documentation: `Stickers <https://mpd.readthedocs.io/en/latest/protocol.html#stickers>`_ + +* **sticker get** -> str +* **sticker set** -> None +* **sticker delete** -> None +* **sticker list** -> list +* **sticker find** -> list[dict] + +Connection settings +^^^^^^^^^^^^^^^^^^^ + +Protocol documentation: `Connection settings <https://mpd.readthedocs.io/en/latest/protocol.html#connection-settings>`_ + +* **password** -> None +* **ping** -> None +* **binarylimit** -> None +* **tagtypes** -> list +* **tagtypes disable** -> None +* **tagtypes enable** -> None +* **tagtypes clear** -> None +* **tagtypes all** -> None + +Partition Commands +^^^^^^^^^^^^^^^^^^ + +Protocol documentation: `Partition Commands <https://mpd.readthedocs.io/en/latest/protocol.html#partition-commands>`_ + +* **partition** -> None +* **listpartitions** -> list +* **newpartition** -> None +* **delpartition** -> None +* **moveoutput** -> None + +Audio output devices +^^^^^^^^^^^^^^^^^^^^ + +Protocol documentation: `Audio output devices <https://mpd.readthedocs.io/en/latest/protocol.html#audio-output-devices>`_ + +* **disableoutput** -> None +* **enableoutput** -> None +* **toggleoutput** -> None +* **outputs** -> list[dict] +* **outputset** -> None + +Reflection +^^^^^^^^^^ + +Protocol documentation: `Reflection <https://mpd.readthedocs.io/en/latest/protocol.html#reflection>`_ + +* **config** -> dict +* **commands** -> list +* **notcommands** -> list +* **urlhandlers** -> list +* **decoders** -> list[dict] + +Client to Client +^^^^^^^^^^^^^^^^ + +Protocol documentation: `Client to Client <https://mpd.readthedocs.io/en/latest/protocol.html#client-to-client>`_ + +* **subscribe** -> None +* **unsubscribe** -> None +* **channels** -> list +* **readmessages** -> list[dict] +* **sendmessage** -> None diff --git a/doc/source/commands.rst b/doc/source/commands.rst index 95ae748..c20e11f 100644 --- a/doc/source/commands.rst +++ b/doc/source/commands.rst @@ -1,4 +1,4 @@ -.. SPDX-FileCopyrightText: 2018-2023 kaliko <kaliko@azylum.org> +.. SPDX-FileCopyrightText: 2018-2024 kaliko <kaliko@azylum.org> .. SPDX-License-Identifier: LGPL-3.0-or-later .. _commands: @@ -13,6 +13,4 @@ Get current available commands: import musicpd print(' '.join([cmd for cmd in musicpd.MPDClient()._commands.keys()])) -List, last updated for v0.8.0: - -.. literalinclude:: commands.txt +.. include:: _commands.rst diff --git a/doc/source/index.rst b/doc/source/index.rst index d16644b..276f92c 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -68,8 +68,8 @@ Contents self use.rst doc.rst - commands.rst examples.rst + commands.rst contribute.rst diff --git a/doc/source/use.rst b/doc/source/use.rst index 88728ef..ff15ff2 100644 --- a/doc/source/use.rst +++ b/doc/source/use.rst @@ -38,7 +38,9 @@ on object string representation. :py:class:`musicpd.MPDClient` methods returns different kinds of objects depending on the command. Could be :py:obj:`None`, a single object as a -:py:obj:`str` or a :py:obj:`dict`, a list of :py:obj:`dict`. +:py:obj:`str`, a :py:obj:`list`, a :py:obj:`dict` or a list of :py:obj:`dict`. +See :ref:`commands exposed in the module<commands>` for more about returned +type. Then :py:class:`musicpd.MPDClient` **methods signatures** are not hard coded within this module since the protocol is handled on the server side. Please diff --git a/musicpd.py b/musicpd.py index e24b51d..96f8c86 100644 --- a/musicpd.py +++ b/musicpd.py @@ -19,7 +19,7 @@ ERROR_PREFIX = "ACK " SUCCESS = "OK" NEXT = "list_OK" #: Module version -VERSION = '0.9.0' +VERSION = '0.9.1' #: Seconds before a connection attempt times out #: (overriden by :envvar:`MPD_TIMEOUT` env. var.) CONNECTION_TIMEOUT = 30 @@ -185,14 +185,14 @@ class MPDClient: .. note:: This is the version of the protocol spoken, not the real version of the daemon.""" self._reset() self._commands = { - # Status Commands + # Querying MPD’s status # querying-mpd-s-status "clearerror": self._fetch_nothing, "currentsong": self._fetch_object, "idle": self._fetch_list, #"noidle": None, "status": self._fetch_object, "stats": self._fetch_object, - # Playback Option Commands + # Playback Option # playback-options "consume": self._fetch_nothing, "crossfade": self._fetch_nothing, "mixrampdb": self._fetch_nothing, @@ -205,7 +205,7 @@ class MPDClient: "replay_gain_mode": self._fetch_nothing, "replay_gain_status": self._fetch_item, "volume": self._fetch_nothing, - # Playback Control Commands + # Controlling playback # controlling-playback "next": self._fetch_nothing, "pause": self._fetch_nothing, "play": self._fetch_nothing, @@ -215,7 +215,7 @@ class MPDClient: "seekid": self._fetch_nothing, "seekcur": self._fetch_nothing, "stop": self._fetch_nothing, - # Queue Commands + # The Queue # the-queue "add": self._fetch_nothing, "addid": self._fetch_item, "clear": self._fetch_nothing, @@ -238,7 +238,7 @@ class MPDClient: "swapid": self._fetch_nothing, "addtagid": self._fetch_nothing, "cleartagid": self._fetch_nothing, - # Stored Playlist Commands + # Stored playlists # stored-playlists "listplaylist": self._fetch_list, "listplaylistinfo": self._fetch_songs, "listplaylists": self._fetch_playlists, @@ -250,7 +250,7 @@ class MPDClient: "rename": self._fetch_nothing, "rm": self._fetch_nothing, "save": self._fetch_nothing, - # Database Commands + # The music database # the-music-database "albumart": self._fetch_composite, "count": self._fetch_object, "getfingerprint": self._fetch_object, @@ -268,18 +268,18 @@ class MPDClient: "searchaddpl": self._fetch_nothing, "update": self._fetch_item, "rescan": self._fetch_item, - # Mounts and neighbors + # Mounts and neighbors # mounts-and-neighbors "mount": self._fetch_nothing, "unmount": self._fetch_nothing, "listmounts": self._fetch_mounts, "listneighbors": self._fetch_neighbors, - # Sticker Commands + # Stickers # stickers "sticker get": self._fetch_item, "sticker set": self._fetch_nothing, "sticker delete": self._fetch_nothing, "sticker list": self._fetch_list, "sticker find": self._fetch_songs, - # Connection Commands + # Connection settings # connection-settings "close": None, "kill": None, "password": self._fetch_nothing, @@ -290,25 +290,25 @@ class MPDClient: "tagtypes enable": self._fetch_nothing, "tagtypes clear": self._fetch_nothing, "tagtypes all": self._fetch_nothing, - # Partition Commands + # Partition Commands # partition-commands "partition": self._fetch_nothing, "listpartitions": self._fetch_list, "newpartition": self._fetch_nothing, "delpartition": self._fetch_nothing, "moveoutput": self._fetch_nothing, - # Audio Output Commands + # Audio output devices # audio-output-devices "disableoutput": self._fetch_nothing, "enableoutput": self._fetch_nothing, "toggleoutput": self._fetch_nothing, "outputs": self._fetch_outputs, "outputset": self._fetch_nothing, - # Reflection Commands + # Reflection # reflection "config": self._fetch_object, "commands": self._fetch_list, "notcommands": self._fetch_list, "urlhandlers": self._fetch_list, "decoders": self._fetch_plugins, - # Client to Client + # Client to Client # client-to-client "subscribe": self._fetch_nothing, "unsubscribe": self._fetch_nothing, "channels": self._fetch_list, -- 2.39.5 From aeaa15ea394b637f89475a64dd52d6642bb8e49c Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Sun, 25 Aug 2024 12:37:08 +0200 Subject: [PATCH 06/16] Add searchcount command (closes #18) --- CHANGES.txt | 1 + doc/source/_commands.rst | 1 + musicpd.py | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 449772c..54035c1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,7 @@ python-musicpd Changes List Changes in 0.9.1 ---------------- + * Add searchcount command * Improved documentation, add supported commands rtype Changes in 0.9.0 diff --git a/doc/source/_commands.rst b/doc/source/_commands.rst index 18a7343..9a85b86 100644 --- a/doc/source/_commands.rst +++ b/doc/source/_commands.rst @@ -109,6 +109,7 @@ Protocol documentation: `The music database <https://mpd.readthedocs.io/en/lates * **search** -> list[dict] * **searchadd** -> None * **searchaddpl** -> None +* **searchcount** -> dict * **update** -> str * **rescan** -> str diff --git a/musicpd.py b/musicpd.py index 96f8c86..116f5cc 100644 --- a/musicpd.py +++ b/musicpd.py @@ -266,6 +266,7 @@ class MPDClient: "search": self._fetch_songs, "searchadd": self._fetch_nothing, "searchaddpl": self._fetch_nothing, + "searchcount": self._fetch_object, "update": self._fetch_item, "rescan": self._fetch_item, # Mounts and neighbors # mounts-and-neighbors -- 2.39.5 From 6364ca3c78458a1052c7694519a8b948718fa922 Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Sun, 25 Aug 2024 15:37:34 +0200 Subject: [PATCH 07/16] Add stickernames command (closes #19) --- CHANGES.txt | 1 + doc/source/_commands.rst | 1 + musicpd.py | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 54035c1..381d8db 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,7 @@ python-musicpd Changes List Changes in 0.9.1 ---------------- + * Add stickernames command * Add searchcount command * Improved documentation, add supported commands rtype diff --git a/doc/source/_commands.rst b/doc/source/_commands.rst index 9a85b86..432403b 100644 --- a/doc/source/_commands.rst +++ b/doc/source/_commands.rst @@ -133,6 +133,7 @@ Protocol documentation: `Stickers <https://mpd.readthedocs.io/en/latest/protocol * **sticker delete** -> None * **sticker list** -> list * **sticker find** -> list[dict] +* **stickernames** -> list Connection settings ^^^^^^^^^^^^^^^^^^^ diff --git a/musicpd.py b/musicpd.py index 116f5cc..5dc9a14 100644 --- a/musicpd.py +++ b/musicpd.py @@ -280,6 +280,7 @@ class MPDClient: "sticker delete": self._fetch_nothing, "sticker list": self._fetch_list, "sticker find": self._fetch_songs, + "stickernames": self._fetch_list, # Connection settings # connection-settings "close": None, "kill": None, -- 2.39.5 From d051d8b1592fd1cb9b46973b5b5022a5fed1f532 Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Sun, 25 Aug 2024 16:06:55 +0200 Subject: [PATCH 08/16] Add playlistlength command (closes #17) --- CHANGES.txt | 1 + doc/source/_commands.rst | 1 + musicpd.py | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 381d8db..65bf841 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,7 @@ python-musicpd Changes List Changes in 0.9.1 ---------------- + * Add playlistlength command * Add stickernames command * Add searchcount command * Improved documentation, add supported commands rtype diff --git a/doc/source/_commands.rst b/doc/source/_commands.rst index 432403b..b145a92 100644 --- a/doc/source/_commands.rst +++ b/doc/source/_commands.rst @@ -84,6 +84,7 @@ Protocol documentation: `Stored playlists <https://mpd.readthedocs.io/en/latest/ * **playlistadd** -> None * **playlistclear** -> None * **playlistdelete** -> None +* **playlistlength** -> dict * **playlistmove** -> None * **rename** -> None * **rm** -> None diff --git a/musicpd.py b/musicpd.py index 5dc9a14..22d8d2b 100644 --- a/musicpd.py +++ b/musicpd.py @@ -246,6 +246,7 @@ class MPDClient: "playlistadd": self._fetch_nothing, "playlistclear": self._fetch_nothing, "playlistdelete": self._fetch_nothing, + "playlistlength": self._fetch_object, "playlistmove": self._fetch_nothing, "rename": self._fetch_nothing, "rm": self._fetch_nothing, -- 2.39.5 From 21c4f762a3179c8482bf8555a6328d0adf52a50e Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Mon, 11 Nov 2024 09:48:15 +0100 Subject: [PATCH 09/16] ci: Add python 3.13 test --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6576783..6da6300 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,6 +30,12 @@ stages: - test.py - if: $CI_PIPELINE_SOURCE == "schedule" +test-py3.13: + extends: + - .cache_python + - .test + image: "python:3.13" + test-py3.12: extends: - .cache_python -- 2.39.5 From b356e08367145802b9ee5a5a5e5339a4f03636a5 Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Mon, 11 Nov 2024 09:57:27 +0100 Subject: [PATCH 10/16] Fixed missing build-backend in pyproject.toml --- CHANGES.txt | 5 +++++ musicpd.py | 2 +- pyproject.toml | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 65bf841..c2da465 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,11 @@ python-musicpd Changes List =========================== +Changes in 0.9.2 +---------------- + + * Add missing build-backend in pyproject.toml + Changes in 0.9.1 ---------------- diff --git a/musicpd.py b/musicpd.py index 22d8d2b..2e82d4a 100644 --- a/musicpd.py +++ b/musicpd.py @@ -19,7 +19,7 @@ ERROR_PREFIX = "ACK " SUCCESS = "OK" NEXT = "list_OK" #: Module version -VERSION = '0.9.1' +VERSION = '0.9.2.dev1' #: Seconds before a connection attempt times out #: (overriden by :envvar:`MPD_TIMEOUT` env. var.) CONNECTION_TIMEOUT = 30 diff --git a/pyproject.toml b/pyproject.toml index a3f46bd..00c9be1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ sphinx = ["Sphinx>=5.3.0"] [build-system] requires = ["setuptools>=61.0.0"] +build-backend = "setuptools.build_meta" [tool.setuptools] py-modules = ["musicpd"] -- 2.39.5 From 0556a6328f3cb3cab316fe7a5ed99114a83ea1e1 Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Sun, 23 Mar 2025 12:27:40 +0100 Subject: [PATCH 11/16] Fixed deprecation in pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 00c9be1..5c79df2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023 kaliko <kaliko@azylum.org> +# SPDX-FileCopyrightText: 2023-2025 kaliko <kaliko@azylum.org> # SPDX-License-Identifier: LGPL-3.0-or-later [project] name = "python-musicpd" @@ -7,7 +7,7 @@ description = "An MPD (Music Player Daemon) client library written in pure Pytho authors = [ { name="Kaliko Jack", email="kaliko@azylum.org" }, ] -license = {file = "LICENSE.txt"} +license = "LGPL-3.0-or-later" readme = "README.rst" requires-python = ">=3.6" classifiers = [ -- 2.39.5 From 9424e553f3a35a6c2475698423cbdae34423f772 Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Sun, 23 Mar 2025 12:42:54 +0100 Subject: [PATCH 12/16] Add protocol commands --- CHANGES.txt | 1 + musicpd.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index c2da465..a082fa4 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,7 @@ Changes in 0.9.2 ---------------- * Add missing build-backend in pyproject.toml + * Add protocol commands Changes in 0.9.1 ---------------- diff --git a/musicpd.py b/musicpd.py index 2e82d4a..64c57d0 100644 --- a/musicpd.py +++ b/musicpd.py @@ -293,6 +293,12 @@ class MPDClient: "tagtypes enable": self._fetch_nothing, "tagtypes clear": self._fetch_nothing, "tagtypes all": self._fetch_nothing, + "protocol": self._fetch_list, + "protocol disable": self._fetch_nothing, + "protocol enable": self._fetch_nothing, + "protocol clear": self._fetch_nothing, + "protocol all": self._fetch_nothing, + "protocol available": self._fetch_list, # Partition Commands # partition-commands "partition": self._fetch_nothing, "listpartitions": self._fetch_list, -- 2.39.5 From 730b855d473a373c2ad2b545ba3e01753861a747 Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Sun, 23 Mar 2025 12:47:40 +0100 Subject: [PATCH 13/16] Add stickernamestypes and stickertypes commands --- CHANGES.txt | 1 + musicpd.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index a082fa4..1e5758a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ Changes in 0.9.2 * Add missing build-backend in pyproject.toml * Add protocol commands + * Add stickernamestypes and stickertypes commands Changes in 0.9.1 ---------------- diff --git a/musicpd.py b/musicpd.py index 64c57d0..df6aaee 100644 --- a/musicpd.py +++ b/musicpd.py @@ -282,6 +282,8 @@ class MPDClient: "sticker list": self._fetch_list, "sticker find": self._fetch_songs, "stickernames": self._fetch_list, + "stickertypes": self._fetch_list, + "stickernamestypes": self._fetch_list, # Connection settings # connection-settings "close": None, "kill": None, -- 2.39.5 From 9d698390d99effbaa041fea2ea7b76bca00c448f Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Sun, 23 Mar 2025 13:02:41 +0100 Subject: [PATCH 14/16] Add searchplaylist command --- CHANGES.txt | 1 + musicpd.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 1e5758a..39ee275 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,7 @@ Changes in 0.9.2 * Add missing build-backend in pyproject.toml * Add protocol commands * Add stickernamestypes and stickertypes commands + * Add searchplaylist command Changes in 0.9.1 ---------------- diff --git a/musicpd.py b/musicpd.py index df6aaee..49d6b3f 100644 --- a/musicpd.py +++ b/musicpd.py @@ -241,6 +241,7 @@ class MPDClient: # Stored playlists # stored-playlists "listplaylist": self._fetch_list, "listplaylistinfo": self._fetch_songs, + "searchplaylist": self._fetch_songs, "listplaylists": self._fetch_playlists, "load": self._fetch_nothing, "playlistadd": self._fetch_nothing, -- 2.39.5 From c618aabe18c19a7d1fa7f11e6ac50bdec5883415 Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Sun, 23 Mar 2025 13:27:13 +0100 Subject: [PATCH 15/16] Fixed deprecation in pyproject.toml --- CHANGES.txt | 1 + pyproject.toml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 39ee275..97af4f1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,7 @@ Changes in 0.9.2 * Add protocol commands * Add stickernamestypes and stickertypes commands * Add searchplaylist command + * Fixed deprecation in pyproject.toml Changes in 0.9.1 ---------------- diff --git a/pyproject.toml b/pyproject.toml index 5c79df2..c684c03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ requires-python = ">=3.6" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", - "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", -- 2.39.5 From 57edf01f2d92ba03ead09f4619b4ef40c508a622 Mon Sep 17 00:00:00 2001 From: Kaliko Jack <kaliko@azylum.org> Date: Sun, 23 Mar 2025 13:30:55 +0100 Subject: [PATCH 16/16] Releasing 0.9.2 --- doc/source/_commands.rst | 11 ++++++++++- musicpd.py | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/source/_commands.rst b/doc/source/_commands.rst index b145a92..1f0b5b9 100644 --- a/doc/source/_commands.rst +++ b/doc/source/_commands.rst @@ -1,4 +1,4 @@ -Below the commands list last updated for v0.9.1. +Below the commands list last updated for v0.9.2. Querying MPD’s status ^^^^^^^^^^^^^^^^^^^^^ @@ -79,6 +79,7 @@ Protocol documentation: `Stored playlists <https://mpd.readthedocs.io/en/latest/ * **listplaylist** -> list * **listplaylistinfo** -> list[dict] +* **searchplaylist** -> list[dict] * **listplaylists** -> dict * **load** -> None * **playlistadd** -> None @@ -135,6 +136,8 @@ Protocol documentation: `Stickers <https://mpd.readthedocs.io/en/latest/protocol * **sticker list** -> list * **sticker find** -> list[dict] * **stickernames** -> list +* **stickertypes** -> list +* **stickernamestypes** -> list Connection settings ^^^^^^^^^^^^^^^^^^^ @@ -149,6 +152,12 @@ Protocol documentation: `Connection settings <https://mpd.readthedocs.io/en/late * **tagtypes enable** -> None * **tagtypes clear** -> None * **tagtypes all** -> None +* **protocol** -> list +* **protocol disable** -> None +* **protocol enable** -> None +* **protocol clear** -> None +* **protocol all** -> None +* **protocol available** -> list Partition Commands ^^^^^^^^^^^^^^^^^^ diff --git a/musicpd.py b/musicpd.py index 49d6b3f..af497c1 100644 --- a/musicpd.py +++ b/musicpd.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# SPDX-FileCopyrightText: 2012-2024 kaliko <kaliko@azylum.org> +# SPDX-FileCopyrightText: 2012-2025 kaliko <kaliko@azylum.org> # SPDX-FileCopyrightText: 2021 Wonko der Verständige <wonko@hanstool.org> # SPDX-FileCopyrightText: 2019 Naglis Jonaitis <naglis@mailbox.org> # SPDX-FileCopyrightText: 2019 Bart Van Loon <bbb@bbbart.be> @@ -19,7 +19,7 @@ ERROR_PREFIX = "ACK " SUCCESS = "OK" NEXT = "list_OK" #: Module version -VERSION = '0.9.2.dev1' +VERSION = '0.9.2' #: Seconds before a connection attempt times out #: (overriden by :envvar:`MPD_TIMEOUT` env. var.) CONNECTION_TIMEOUT = 30 -- 2.39.5