[Pkg-mpd-commits] [python-mpd] 244/262: add neighbors and mount commands

Simon McVittie smcv at debian.org
Sun May 22 18:16:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch upstream
in repository python-mpd.

commit a458aa64d85c642b83532fff94326706714dfc9e
Author: Jörg Thalheim <joerg at higgsboson.tk>
Date:   Fri Nov 21 17:13:32 2014 +0100

    add neighbors and mount commands
    
    fixes #44
---
 doc/generate_command_reference.py |  2 +-
 doc/topics/commands.rst           | 50 +++++++++++++++++++++++++++++++++++++++
 mpd.py                            | 11 +++++++++
 3 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/doc/generate_command_reference.py b/doc/generate_command_reference.py
index 1104b01..da902de 100644
--- a/doc/generate_command_reference.py
+++ b/doc/generate_command_reference.py
@@ -32,7 +32,7 @@ for section in chapter.xpath("section"):
         text = paragraph.text.rstrip()
         paragraphs.append(text)
     print("\n".join(paragraphs))
-    print()
+    print("")
 
     for entry in section.xpath("variablelist/varlistentry"):
         cmd = entry.xpath("term/cmdsynopsis/command")[0].text
diff --git a/doc/topics/commands.rst b/doc/topics/commands.rst
index 1610a64..b5b9f5e 100644
--- a/doc/topics/commands.rst
+++ b/doc/topics/commands.rst
@@ -585,6 +585,56 @@ The music database
               unmodified files.
 
 
+Mounts and neighbors
+--------------------
+
+        A "storage" provides access to files in a directory tree.  The
+        most basic storage plugin is the "local" storage plugin which
+        accesses the local file system, and there are plugins to
+        access NFS and SMB servers.
+
+        Multiple storages can be "mounted" together, similar to the
+
+.. function:: MPDClient.mount(path, uri)
+
+              Mount the specified remote storage URI at the given
+              path.  Example::
+
+
+                mount foo nfs://192.168.1.4/export/mp3
+.. function:: MPDClient.unmount(path)
+
+              Unmounts the specified path.  Example::
+
+
+                unmount foo
+.. function:: MPDClient.listmounts()
+
+              Queries a list of all mounts.  By default, this contains
+              just the configured music_directory .
+              Example::
+
+
+                listmounts
+                mount: 
+                storage: /home/foo/music
+                mount: foo
+                storage: nfs://192.168.1.4/export/mp3
+                OK
+                
+.. function:: MPDClient.listneighbors()
+
+              Queries a list of "neighbors" (e.g. accessible file
+              servers on the local net).  Items on that list may be
+              used with the 
+              command.  Example::
+
+
+                listneighbors
+                neighbor: smb://FOO
+                name: FOO (Samba 4.1.11-Debian)
+                OK
+                
 Stickers
 --------
 
diff --git a/mpd.py b/mpd.py
index 6513e94..a3b0713 100644
--- a/mpd.py
+++ b/mpd.py
@@ -152,6 +152,11 @@ _commands = {
     "searchaddpl":        "_fetch_nothing",
     "update":             "_fetch_item",
     "rescan":             "_fetch_item",
+    # Mounts and neighbors
+    "mount":              "_fetch_nothing",
+    "umount":             "_fetch_nothing",
+    "listmounts":         "_fetch_mounts",
+    "listneighbors":      "_fetch_neighbors",
     # Sticker Commands
     "sticker get":        "_fetch_sticker",
     "sticker set":        "_fetch_nothing",
@@ -400,6 +405,12 @@ class MPDClient(object):
     def _fetch_songs(self):
         return self._fetch_objects(["file"])
 
+    def _fetch_mounts(self):
+        return self._fetch_objects(["mount"])
+
+    def _fetch_neighbors(self):
+        return self._fetch_objects(["neighbor"])
+
     def _fetch_playlists(self):
         return self._fetch_objects(["playlist"])
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git



More information about the Pkg-mpd-commits mailing list