xchat 2.x plugins

Note: I've converted my development from subversion to mercurial. The old svn links to individual files will probably remain for quite some time, but I urge you to use the new hg links. Eventually, the svn will be taken down, and redirects for important revisions will be installed.

I IRC (as a verb) a lot, and have written a few python plugins for the xchat IRC client. Because of the similarity between the scripting interfaces and the availability of python as a scripting language, many of these have been ported to the weechat command line IRC client.

some links

scripts

Since I have integrated the banshee code with pymp, I have a fully functional python xchat script lying around that does something useful and shows various beneficial paradigms both of python and of the xchat python interface. Since it is very short and very clean, I've decided to make it available.

xdccq

a simple xdcc queue

Keeps a local queue of xdcc requests, and dishes them out as files finish.

New in 0.6: Ability to provide steps to ranges. Thanks to Jan Malakhovski for the patch for this functionality.

usage

 /xdccq [cmd] [args]
    help               - help on commands
    [ls, list]         - lists files in queue
    get [bot] [#, #-#] - adds 'send' cmds to queue
    rm [bot] <#, #-#>  - removes 'send' cmds from queue
    [cancel, stop]     - cancels current transfer(s)
    multiq             - toggles multi-queue mode (1 queue per bot)

 examples:
    /xdccq get SampleXDCCbot 1,3,5-10
      packs 1, 3, 5, 6, 7, 8, 9, 10 are queued
    /xdccq rm SampleXDCCbot 1-7
      packs 8, 9, 10 are queued
    /xdccq get SampleXDCCbot 3-6,12
      packs 3, 4, 5, 6, 7, 8, 9, 10, 12 are queued
    /xdccq rm SampleXDCCbot
      all packs from SampleXDCCbot are removed
    /xdccq get SampleXDCCbot 0-10%2
      packs 0,2,4,6,8,10 are queued
	

download

Download a version of xdccq or grab the latest dev version:

dcclog

a dcc event logger

Keeps a log of DCC events, concentrating on RECV events. It should work on Windows and Linux, but hasn't been tested in Windows. The default location for the log is XCHAT_HOME/dcclog.txt, but this can be changed. The log format is customizeable with an interpolated string format (note that $ is used for the interpolation sigil instead of % because of technical limitations of the python ConfigParser module)

usage

    no options         - shows configuration options
    [help, ?] <cmd>    - prints this help or detailed help for 'cmd'
    set [opt] [value]  - sets configuration option 'opt' to 'value'

logformat options

$DDate (2006.10.25)
$TTime (24hr)
$tTime (12hr)
$NNick of sender
$Ffilename
$CCPS
$Rbytes received
$Zfilesize
$Uresume point (0 if not resumed)

A sample logformat: (the default one)

"$D $T :$S: $N "$F" [$R/$Z @ $C from byte $U]"

download

Download a version from the svn.

pymp

audio player announce script

New in version 0.7

This latest update adds Amarok2 support and an optional menu. To enable the menu, open the script and change ENABLE_MENU from False to True.

about pymp

Pymp is an xchat plugin to support various music players from a single common interface. It's been in development for almost 3 years, slowly gaining in player support. Right now, it supports the following players:

The script uses the legacy xmms unix socket to communicate with xmms, and beep. Audacious is now supported via DBus, exclusively; you'll need the python-dbus bindings for this and other DBus-only supported players. If you are running a modern distribution that uses Gnome or KDE4, you already have these bindings.

For banshee, the script has to fork and execute a child process to get the information or to control the player. This leads to a small delay; if you really like banshee and want me to experiment with spawning threads to do this, please email me.

Finally, DCOP is being phased out of KDE. This means that Juk (which has not and probably will not be ported to KDE4) will probably eventually be phased out of support, and Amarok 2.0 support will have to wait until I get around to testing it (whenever it hits Ubuntu or Debian).

usage

 Commands:
    /mp3          : announce the currently playing mp3
    /mp3     stop : stop playing
    /mp3     play : start playing
    /mp3    pause : pause playback
    /mp3 next [#] : skip to next (# of) track(s)
    /mp3 prev [#] : skip to prev (# of) track(s)
    /mp3     open : open files
	

Note that pause is actually a play toggle, and using it will either pause currently playing music or play currently paused music. stop is the same as pressing the 'stop' button in xmms/beep/audacious (a pause, releasing the audio hardware, and seeking to the beginning of the song) but this behavior is not even available in banshee, so for banshee stop pauses the track but will not unpause if repeated.

download

Download a version of pymp (mp3.py)