py-libmpdclient2 1.0
Python client library for MPD (Music Player Daemon)
============= the situation ============= I wrote py-libmpdclient a while back, basically as a direct translation of the C libmpdclient to Python. It works and stuff, but there are some problems: ----------------------- overall design problems ----------------------- - There is lots of dumb repetetive code for implementing the various mpd commands - There are too many mostly-useless classes and boilerplate type code that really is not helpful - As new fields are added to the output of existing commands, the hard-wired handling of them gets out of sync, and ideally should simply be avoided - Adding new commands requires patching on more methods ----------------------- just plain dumb stuff ----------------------- - Error handling is broken and dumb - Leftover C-isms like mapping strings to numbers where there's no reason to =========== version two =========== So ok, let's fix it. Basic ideas: - Simple: Keep the mechanics simple. The protocol boils down to sets of key/ value pairs, so let's base the design on that. - Dynamic: Define the commands and their behavior in one place, and use Python's dynamic nature to automatically set up code to handle all of the commands. Adding new commands should be as simple as adding an entry to some data structure. -------------------- more on the protocol -------------------- MPD's protocol is line-based (linefeed (\n) delimited). Every line sent from the client to the server is a command that elicits a response, with the exception of command lists. A command list begins with command_list_begin, followed by an arbitrary number of commands, followed by command_list_end. The entire command list gets one response -- OK if all commands succeeded, ACK if any failed, and no commands after the failed command will have been executed.
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| py-libmpdclient2-1.0.tar.gz (md5, pgp) | Source | 2008-08-31 22:57:08 | 3KB | 194 | |
- Author: Nick Welch <mack at incise org>
- Home Page: http://incise.org/index.cgi/py-libmpdclient2
- Download URL: http://incise.org/files/dev/py-libmpdclient2-1.0.tgz
- Keywords: mpd music player daemon library
- Categories
- Package Index Owner: Rick
- DOAP record: py-libmpdclient2-1.0.xml
Log in to rate this package.
