Configuration is via file. On Unix-like systems (includding OSX?), the
file is read from ~/.sgwpupdate.conf or /etc/sgwpupdate.conf. If
both exist, entries in the former override those in the latter. The
file format is the usual WIN.INI style, with sections denoted by
square brackets and items specified as item = value. Normally, the
file will have two sections: the standard [sgwpupdate] section and a
module specific section such as [sgwpmpd].
The supported configuration items in [sgwpupdate] section are:
blog - URL to WordPress blog, such as http://www.example.net/wordpress
password - simple password to allow updates, must match option in
plugin configuration.
module - name of python module to do player specific update.
logfile - full path to logfile (optional)
pidfile - full path to name of file where PID will be written, if
running in daemon mode. (optional)
The supported configuration items for the [sgwpmpd] module section are:
mpdhost - name of host where MPD is running, eg localhost or
mpd.example.net
mpdport - TCP port number for MPD. Almost always 6600.
Write a Python module containing a function name getsong that takes
a single argument, which will be a dictionary of the config items from
the module-specific configuration section. The function should return
a tuple of (remainingtime, songdata). The remainingtime value sets
how long sgwpupdate.py will wait before checking again in daemon
mode. The dictionary songdata should contain the following keys:
artist - song performer or writer.
title - song title.
album - album title for the song.
state - current state of the player, should be one of 'play',
'pause', or 'stop'.
Your best bet is probably to copy sgwpmpd.py and work from there.




