Skip to content

Commit 02783e7

Browse files
committed
Fixes for the documentation
1 parent b26cd7d commit 02783e7

File tree

5 files changed

+184
-127
lines changed

5 files changed

+184
-127
lines changed

MANIFEST.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
exclude setup.cfg
22
include *.txt
3-
recursive-include doc *.txt
3+
include *.rst
4+
recursive-include doc *.rst

README.rst

+15-7
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Difference with python-mpd
1212
--------------------------
1313

1414
python-mpd2 is a fork of
15-
`python-mpd <http://jatreuman.indefero.net/p/python-mpd/>`_.
15+
`python-mpd`_.
1616
python-mpd2 is a fork of `python-mpd`_. While 0.4.x was backwards compatible
1717
with python-mpd, starting with 0.5 provides enhanced features
1818
which are *NOT* backward compatibles with the original `python-mpd`_ package.
@@ -28,12 +28,11 @@ The following features were added:
2828
- explicitly declared MPD commands (which is handy when using for
2929
example `IPython <http://ipython.org>`_)
3030
- a test suite
31-
- API documentation to add new commands (see `Future
32-
Compatible <#future-compatible>`_)
31+
- API documentation to add new commands (see `Future Compatible`_
3332
- support for Unicode strings in all commands (optionally in python2,
34-
default in python3 - see `Unicode Handling <#unicode-handling>`_)
33+
default in python3 - see `Unicode Handling`_)
3534
- configureable timeouts
36-
- support for `logging <#logging>`_
35+
- support for `logging`_
3736
- improved support for sticker
3837

3938
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
184183
the instance with the ``use_unicode`` parameter set to ``True``.
185184

186185
Using Unicode strings should be prefered as it is done transparently by
187-
the library for you, and makes the transition to Python 3 easier.
186+
the library for you, and makes the transition to Python 3 easier::
187+
188+
>>> import mpd
189+
>>> client = MPDClient(use_unicode=True)
190+
>>> client.urlhandlers()[0]
191+
u'http'
192+
>>> client.use_unicode = False # Can be switched back later
193+
>>> client.urlhandlers()[0]
194+
'http'
188195

189-
``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'``
190196
Using this option in Python 3 doesn't have any effect.
191197

192198
Logging
@@ -257,3 +263,5 @@ [email protected].
257263
He can also be found idling in #mpd on irc.freenode.net as jat.
258264

259265
.. |Build Status| image:: https://travis-ci.org/Mic92/python-mpd2.png
266+
267+
.. _python-mpd: http://jatreuman.indefero.net/p/python-mpd/

doc/commands.rst

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
========
2+
Commands
3+
========
4+
5+
Status Commands
6+
---------------
7+
8+
=========== ======= ================
9+
clearerror -> fetch_nothing
10+
currentsong -> fetch_object
11+
idle [<str>] -> fetch_list
12+
noidle -> None
13+
status -> fetch_object
14+
stats -> fetch_object
15+
=========== ======= ================
16+
17+
Playback Option Commands
18+
------------------------
19+
================== ====== ================
20+
consume <bool> -> fetch_nothing
21+
crossfade <int> -> fetch_nothing
22+
mixrampdb <str> -> fetch_nothing
23+
mixrampdelay <int> -> fetch_nothing
24+
random <bool> -> fetch_nothing
25+
repeat <bool> -> fetch_nothing
26+
setvol <int> -> fetch_nothing
27+
single <bool> -> fetch_nothing
28+
replay_gain_mode <str> -> fetch_nothing
29+
replay_gain_status -> fetch_item
30+
================== ====== ================
31+
32+
Playback Control Commands
33+
-------------------------
34+
35+
======== =========== ================
36+
next -> fetch_nothing
37+
pause [<bool>] -> fetch_nothing
38+
play [<int>] -> fetch_nothing
39+
playid [<int>] -> fetch_nothing
40+
previous -> fetch_nothing
41+
seek <int> <int> -> fetch_nothing
42+
seekid <int> <int> -> fetch_nothing
43+
seekcur <int> -> fetch_nothing
44+
stop -> fetch_nothing
45+
======== =========== ================
46+
47+
Playlist Commands
48+
-----------------
49+
50+
============== ============= ================
51+
add <str> -> fetch_nothing
52+
addid <str> [<int>] -> fetch_item
53+
clear -> fetch_nothing
54+
delete <int> -> fetch_nothing
55+
deleteid <int> -> fetch_nothing
56+
move <int> <int> -> fetch_nothing
57+
moveid <int> <int> -> fetch_nothing
58+
playlist -> fetch_playlist
59+
playlistfind <locate> -> fetch_songs
60+
playlistid [<int>] -> fetch_songs
61+
playlistinfo [<int>] -> fetch_songs
62+
playlistsearch <locate> -> fetch_songs
63+
plchanges <int> -> fetch_songs
64+
plchangesposid <int> -> fetch_changes
65+
prio <int> <str> -> fetch_nothing
66+
prioid <int> <id> -> fetch_nothing
67+
shuffle [<str>] -> fetch_nothing
68+
swap <int> <int> -> fetch_nothing
69+
swapid <int> <int> -> fetch_nothing
70+
============== ============= ================
71+
72+
Stored Playlist Commands
73+
------------------------
74+
75+
================ ================= ==================
76+
listplaylist <str> -> fetch_list
77+
listplaylistinfo <str> -> fetch_songs
78+
listplaylists -> fetch_playlists
79+
load <str> -> fetch_nothing
80+
playlistadd <str> <str> -> fetch_nothing
81+
playlistclear <str> -> fetch_nothing
82+
playlistdelete <str> <int> -> fetch_nothing
83+
playlistmove <str> <int> <int> -> fetch_nothing
84+
rename <str> <str> -> fetch_nothing
85+
rm <str> -> fetch_nothing
86+
save <str> -> fetch_nothing
87+
================ ================= ==================
88+
89+
Database Commands
90+
-----------------
91+
92+
=========== ================ =================
93+
count <locate> -> fetch_object
94+
find <locate> -> fetch_songs
95+
findadd <locate> -> fetch_nothing
96+
list <str> [<locate>] -> fetch_list
97+
listall [<str>] -> fetch_database
98+
listallinfo [<str>] -> fetch_database
99+
lsinfo [<str>] -> fetch_database
100+
search <locate> -> fetch_songs
101+
searchadd <locate> -> fetch_songs
102+
searchaddpl <str> <locate> -> fetch_songs
103+
update [<str>] -> fetch_item
104+
rescan [<str>] -> fetch_item
105+
=========== ================ =================
106+
107+
Sticker Commands
108+
----------------
109+
110+
============== ======================= ================
111+
sticker get <str> <str> <str> -> fetch_item
112+
sticker set <str> <str> <str> <str> -> fetch_nothing
113+
sticker delete <str> <str> [<str>] -> fetch_nothing
114+
sticker list <str> <str> -> fetch_list
115+
sticker find <str> <str> <str> -> fetch_songs
116+
============== ======================= ================
117+
118+
Connection Commands
119+
-------------------
120+
121+
======== ===== ================
122+
close -> None
123+
kill -> None
124+
password <str> -> fetch_nothing
125+
ping -> fetch_nothing
126+
======== ===== ================
127+
128+
Audio Output Commands
129+
---------------------
130+
131+
============= ===== ================
132+
disableoutput <int> -> fetch_nothing
133+
enableoutput <int> -> fetch_nothing
134+
outputs -> fetch_outputs
135+
============= ===== ================
136+
137+
Reflection Commands
138+
-------------------
139+
140+
=========== ================
141+
config -> fetch_item
142+
commands -> fetch_list
143+
notcommands -> fetch_list
144+
tagtypes -> fetch_list
145+
urlhandlers -> fetch_list
146+
decoders -> fetch_plugins
147+
=========== ================
148+
149+
Client To Client
150+
----------------
151+
152+
=========== =========== =================
153+
subscribe <str> -> fetch_nothing
154+
unsubscribe <str> -> fetch_nothing
155+
channels -> fetch_list
156+
readmessages -> fetch_messages
157+
sendmessage <str> <str> -> fetch_nothing
158+
=========== =========== =================

doc/commands.txt

-111
This file was deleted.

setup.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
from distutils.core import setup
44
from setuptools import Extension
55
from setuptools.command.test import test as TestCommand
6-
import sys
6+
import sys,os
77
import mpd
88

9-
DESCRIPTION = """\
10-
An MPD (Music Player Daemon) client library written in pure Python.\
11-
"""
12-
139
CLASSIFIERS = [
1410
"Development Status :: 5 - Production/Stable",
1511
"Intended Audience :: Developers",
@@ -48,15 +44,20 @@ def run_tests(self):
4844
errno = tox.cmdline(self.test_args)
4945
sys.exit(errno)
5046

47+
def read(fname):
48+
return open(os.path.join(os.path.dirname(__file__), fname)).read()
49+
50+
VERSION = ".".join(map(str, mpd.VERSION))
51+
5152
setup(
5253
name="python-mpd2",
53-
version=".".join(map(str, mpd.VERSION)),
54+
version=VERSION,
5455
description="A Python MPD client library",
55-
long_description=DESCRIPTION,
56+
long_description=read('README.rst'),
5657
author="J. Thalheim",
5758
author_email="[email protected]",
5859
url="https://github.com/Mic92/python-mpd2",
59-
download_url="https://github.com/Mic92/python-mpd2",
60+
download_url="https://github.com/Mic92/python-mpd2/archive/v%s.zip" % VERSION,
6061
py_modules=["mpd"],
6162
classifiers=CLASSIFIERS,
6263
#license=LICENSE,

0 commit comments

Comments
 (0)