All pastes #761111 Raw Edit

Untitled

public python v1 · immutable
·published 2007-11-04 16:47 UTC
rendered paste body
import xchatimport subprocessimport re__module_name__ = 'Amarok Now Playing'__module_version__ = '0.1'__module_description__ = 'Display the currently playing track in Amarok'class AmarokPlayer:    def __getattr__(self, name):        return subprocess.Popen(['dcop', 'amarok', 'player', name],                                stdout=subprocess.PIPE).communicate()[0].strip()def on_request(word, word_eol, udata):    player = AmarokPlayer()    xchat.command('ME is playing: %s by %s from %s' %                  (player.title, player.artist, player.album))    return xchat.EAT_ALLxchat.hook_command('NP', on_request)