Permalink
Browse files

Fixes for the documentation

  • Loading branch information...
1 parent b26cd7d commit 02783e7776d7cdb3da341e42ce674df16c35e625 @Mic92 committed Jan 14, 2013
Showing with 184 additions and 127 deletions.
  1. +2 −1 MANIFEST.in
  2. +15 −7 README.rst
  3. +158 −0 doc/commands.rst
  4. +0 −111 doc/commands.txt
  5. +9 −8 setup.py
View
@@ -1,3 +1,4 @@
exclude setup.cfg
include *.txt
-recursive-include doc *.txt
+include *.rst
+recursive-include doc *.rst
View
@@ -12,7 +12,7 @@ Difference with python-mpd
--------------------------
python-mpd2 is a fork of
-`python-mpd <http://jatreuman.indefero.net/p/python-mpd/>`_.
+`python-mpd`_.
python-mpd2 is a fork of `python-mpd`_. While 0.4.x was backwards compatible
with python-mpd, starting with 0.5 provides enhanced features
which are *NOT* backward compatibles with the original `python-mpd`_ package.
@@ -28,12 +28,11 @@ The following features were added:
- explicitly declared MPD commands (which is handy when using for
example `IPython <http://ipython.org>`_)
- a test suite
-- API documentation to add new commands (see `Future
- Compatible <#future-compatible>`_)
+- API documentation to add new commands (see `Future Compatible`_
- support for Unicode strings in all commands (optionally in python2,
- default in python3 - see `Unicode Handling <#unicode-handling>`_)
+ default in python3 - see `Unicode Handling`_)
- configureable timeouts
-- support for `logging <#logging>`_
+- support for `logging`_
- improved support for sticker
If you like this module, you could try contact the original author
@@ -184,9 +183,16 @@ In order for *MPDClient* to return Unicode strings with Python 2, create
the instance with the ``use_unicode`` parameter set to ``True``.
Using Unicode strings should be prefered as it is done transparently by
-the library for you, and makes the transition to Python 3 easier.
+the library for you, and makes the transition to Python 3 easier::
+
+ >>> import mpd
+ >>> client = MPDClient(use_unicode=True)
+ >>> client.urlhandlers()[0]
+ u'http'
+ >>> client.use_unicode = False # Can be switched back later
+ >>> client.urlhandlers()[0]
+ 'http'
-``python >>> import mpd >>> client = MPDClient(use_unicode=True) >>> client.urlhandlers()[0] u'http' >>> client.use_unicode = False # Can be switched back later >>> client.urlhandlers()[0] 'http'``
Using this option in Python 3 doesn't have any effect.
Logging
@@ -257,3 +263,5 @@ jat@spatialrift.net.
He can also be found idling in #mpd on irc.freenode.net as jat.
.. |Build Status| image:: https://travis-ci.org/Mic92/python-mpd2.png
+
+.. _python-mpd: http://jatreuman.indefero.net/p/python-mpd/
View
@@ -0,0 +1,158 @@
+========
+Commands
+========
+
+Status Commands
+---------------
+
+=========== ======= ================
+clearerror -> fetch_nothing
+currentsong -> fetch_object
+idle [<str>] -> fetch_list
+noidle -> None
+status -> fetch_object
+stats -> fetch_object
+=========== ======= ================
+
+Playback Option Commands
+------------------------
+================== ====== ================
+consume <bool> -> fetch_nothing
+crossfade <int> -> fetch_nothing
+mixrampdb <str> -> fetch_nothing
+mixrampdelay <int> -> fetch_nothing
+random <bool> -> fetch_nothing
+repeat <bool> -> fetch_nothing
+setvol <int> -> fetch_nothing
+single <bool> -> fetch_nothing
+replay_gain_mode <str> -> fetch_nothing
+replay_gain_status -> fetch_item
+================== ====== ================
+
+Playback Control Commands
+-------------------------
+
+======== =========== ================
+next -> fetch_nothing
+pause [<bool>] -> fetch_nothing
+play [<int>] -> fetch_nothing
+playid [<int>] -> fetch_nothing
+previous -> fetch_nothing
+seek <int> <int> -> fetch_nothing
+seekid <int> <int> -> fetch_nothing
+seekcur <int> -> fetch_nothing
+stop -> fetch_nothing
+======== =========== ================
+
+Playlist Commands
+-----------------
+
+============== ============= ================
+add <str> -> fetch_nothing
+addid <str> [<int>] -> fetch_item
+clear -> fetch_nothing
+delete <int> -> fetch_nothing
+deleteid <int> -> fetch_nothing
+move <int> <int> -> fetch_nothing
+moveid <int> <int> -> fetch_nothing
+playlist -> fetch_playlist
+playlistfind <locate> -> fetch_songs
+playlistid [<int>] -> fetch_songs
+playlistinfo [<int>] -> fetch_songs
+playlistsearch <locate> -> fetch_songs
+plchanges <int> -> fetch_songs
+plchangesposid <int> -> fetch_changes
+prio <int> <str> -> fetch_nothing
+prioid <int> <id> -> fetch_nothing
+shuffle [<str>] -> fetch_nothing
+swap <int> <int> -> fetch_nothing
+swapid <int> <int> -> fetch_nothing
+============== ============= ================
+
+Stored Playlist Commands
+------------------------
+
+================ ================= ==================
+listplaylist <str> -> fetch_list
+listplaylistinfo <str> -> fetch_songs
+listplaylists -> fetch_playlists
+load <str> -> fetch_nothing
+playlistadd <str> <str> -> fetch_nothing
+playlistclear <str> -> fetch_nothing
+playlistdelete <str> <int> -> fetch_nothing
+playlistmove <str> <int> <int> -> fetch_nothing
+rename <str> <str> -> fetch_nothing
+rm <str> -> fetch_nothing
+save <str> -> fetch_nothing
+================ ================= ==================
+
+Database Commands
+-----------------
+
+=========== ================ =================
+count <locate> -> fetch_object
+find <locate> -> fetch_songs
+findadd <locate> -> fetch_nothing
+list <str> [<locate>] -> fetch_list
+listall [<str>] -> fetch_database
+listallinfo [<str>] -> fetch_database
+lsinfo [<str>] -> fetch_database
+search <locate> -> fetch_songs
+searchadd <locate> -> fetch_songs
+searchaddpl <str> <locate> -> fetch_songs
+update [<str>] -> fetch_item
+rescan [<str>] -> fetch_item
+=========== ================ =================
+
+Sticker Commands
+----------------
+
+============== ======================= ================
+sticker get <str> <str> <str> -> fetch_item
+sticker set <str> <str> <str> <str> -> fetch_nothing
+sticker delete <str> <str> [<str>] -> fetch_nothing
+sticker list <str> <str> -> fetch_list
+sticker find <str> <str> <str> -> fetch_songs
+============== ======================= ================
+
+Connection Commands
+-------------------
+
+======== ===== ================
+close -> None
+kill -> None
+password <str> -> fetch_nothing
+ping -> fetch_nothing
+======== ===== ================
+
+Audio Output Commands
+---------------------
+
+============= ===== ================
+disableoutput <int> -> fetch_nothing
+enableoutput <int> -> fetch_nothing
+outputs -> fetch_outputs
+============= ===== ================
+
+Reflection Commands
+-------------------
+
+=========== ================
+config -> fetch_item
+commands -> fetch_list
+notcommands -> fetch_list
+tagtypes -> fetch_list
+urlhandlers -> fetch_list
+decoders -> fetch_plugins
+=========== ================
+
+Client To Client
+----------------
+
+=========== =========== =================
+subscribe <str> -> fetch_nothing
+unsubscribe <str> -> fetch_nothing
+channels -> fetch_list
+readmessages -> fetch_messages
+sendmessage <str> <str> -> fetch_nothing
+=========== =========== =================
View
@@ -1,111 +0,0 @@
-== Status Commands
-clearerror -> fetch_nothing
-currentsong -> fetch_object
-idle [<str>] -> fetch_list
-noidle -> None
-status -> fetch_object
-stats -> fetch_object
-
-== Playback Option Commands
-consume <bool> -> fetch_nothing
-crossfade <int> -> fetch_nothing
-mixrampdb <str> -> fetch_nothing
-mixrampdelay <int> -> fetch_nothing
-random <bool> -> fetch_nothing
-repeat <bool> -> fetch_nothing
-setvol <int> -> fetch_nothing
-single <bool> -> fetch_nothing
-replay_gain_mode <str> -> fetch_nothing
-replay_gain_status -> fetch_item
-
-== Playback Control Commands
-next -> fetch_nothing
-pause [<bool>] -> fetch_nothing
-play [<int>] -> fetch_nothing
-playid [<int>] -> fetch_nothing
-previous -> fetch_nothing
-seek <int> <int> -> fetch_nothing
-seekid <int> <int> -> fetch_nothing
-seekcur <int> -> fetch_nothing
-stop -> fetch_nothing
-
-== Playlist Commands
-add <str> -> fetch_nothing
-addid <str> [<int>] -> fetch_item
-clear -> fetch_nothing
-delete <int> -> fetch_nothing
-deleteid <int> -> fetch_nothing
-move <int> <int> -> fetch_nothing
-moveid <int> <int> -> fetch_nothing
-playlist -> fetch_playlist
-playlistfind <locate> -> fetch_songs
-playlistid [<int>] -> fetch_songs
-playlistinfo [<int>] -> fetch_songs
-playlistsearch <locate> -> fetch_songs
-plchanges <int> -> fetch_songs
-plchangesposid <int> -> fetch_changes
-prio <int> <str> -> fetch_nothing
-prioid <int> <id> -> fetch_nothing
-shuffle [<str>] -> fetch_nothing
-swap <int> <int> -> fetch_nothing
-swapid <int> <int> -> fetch_nothing
-
-== Stored Playlist Commands
-listplaylist <str> -> fetch_list
-listplaylistinfo <str> -> fetch_songs
-listplaylists -> fetch_playlists
-load <str> -> fetch_nothing
-playlistadd <str> <str> -> fetch_nothing
-playlistclear <str> -> fetch_nothing
-playlistdelete <str> <int> -> fetch_nothing
-playlistmove <str> <int> <int> -> fetch_nothing
-rename <str> <str> -> fetch_nothing
-rm <str> -> fetch_nothing
-save <str> -> fetch_nothing
-
-== Database Commands
-count <locate> -> fetch_object
-find <locate> -> fetch_songs
-findadd <locate> -> fetch_nothing
-list <str> [<locate>] -> fetch_list
-listall [<str>] -> fetch_database
-listallinfo [<str>] -> fetch_database
-lsinfo [<str>] -> fetch_database
-search <locate> -> fetch_songs
-searchadd <locate> -> fetch_songs
-searchaddpl <str> <locate> -> fetch_songs
-update [<str>] -> fetch_item
-rescan [<str>] -> fetch_item
-
-== Sticker Commands
-sticker get <str> <str> <str> -> fetch_item
-sticker set <str> <str> <str> <str> -> fetch_nothing
-sticker delete <str> <str> [<str>] -> fetch_nothing
-sticker list <str> <str> -> fetch_list
-sticker find <str> <str> <str> -> fetch_songs
-
-== Connection Commands
-close -> None
-kill -> None
-password <str> -> fetch_nothing
-ping -> fetch_nothing
-
-== Audio Output Commands
-disableoutput <int> -> fetch_nothing
-enableoutput <int> -> fetch_nothing
-outputs -> fetch_outputs
-
-== Reflection Commands
-config -> fetch_item
-commands -> fetch_list
-notcommands -> fetch_list
-tagtypes -> fetch_list
-urlhandlers -> fetch_list
-decoders -> fetch_plugins
-
-== Client To Client
-subscribe <str> -> fetch_nothing
-unsubscribe <str> -> fetch_nothing
-channels -> fetch_list
-readmessages -> fetch_messages
-sendmessage <str> <str> -> fetch_nothing
View
@@ -3,13 +3,9 @@
from distutils.core import setup
from setuptools import Extension
from setuptools.command.test import test as TestCommand
-import sys
+import sys,os
import mpd
-DESCRIPTION = """\
-An MPD (Music Player Daemon) client library written in pure Python.\
-"""
-
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
@@ -48,15 +44,20 @@ def run_tests(self):
errno = tox.cmdline(self.test_args)
sys.exit(errno)
+def read(fname):
+ return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
+VERSION = ".".join(map(str, mpd.VERSION))
+
setup(
name="python-mpd2",
- version=".".join(map(str, mpd.VERSION)),
+ version=VERSION,
description="A Python MPD client library",
- long_description=DESCRIPTION,
+ long_description=read('README.rst'),
author="J. Thalheim",
author_email="jthalheim@gmail.com",
url="https://github.com/Mic92/python-mpd2",
- download_url="https://github.com/Mic92/python-mpd2",
+ download_url="https://github.com/Mic92/python-mpd2/archive/v%s.zip" % VERSION,
py_modules=["mpd"],
classifiers=CLASSIFIERS,
#license=LICENSE,

0 comments on commit 02783e7

Please sign in to comment.