Archive for the ‘Python’ Category

irssi-python for irssi 0.8.15

Wednesday, March 10th, 2010

I recently became aware of a Python plugin for irssi, which conveniently resides in the irssi SVN repository. This plugin presumably exposes an API very similar to the one used in the Perl plugin, so creating new scripts should be easy with all those Perl samples out there.

There’s an useful guide for building the plugin here, but I found that some lose ends still needed to be patched up.

For one, the plugin apparently hasn’t been updated in a while, so some function calls still reference old irssi structures and functions. Naturally, these don’t compile with irssi 0.8.15, which is the latest version as of this writing. For those issues, I compiled a patch with various fixes here. This isn’t exactly a perfect fix, but should do in most cases. (The name is still 0.8.14 as that is the version it was originally written for, but it still applies cleanly for 0.8.15)

There is one more catch that isn’t mentioned in above guide: The plugin tries to load irssi_startup.py on startup, which will have to be on a specific path to be found. Without any parameters to ./configure, that will be /usr/local/share/irssi/scripts. So, if you’d rather have it in /usr/share/irssi/scripts (this is where my distribution places scripts, at least), you have to explicitly specify this when calling ./configure:

./configure --with-irssi=<path to irssi sources> \
    --datadir=/usr/share

After that, make should (hopefully) work and libpython.so will be placed in src/.libs/. This file should be moved to irssi’s module directory, which should be /usr/lib/irssi/modules or /usr/local/lib/irssi/modules, depending on distribution. Copy irssi_startup.py and irssi.py from src/ to the data directory you specified above, and irssi should be able to load the Python plugin without problems via /load python.

X-Chat plugin: AniDB Search

Friday, March 23rd, 2007

More useless plugins for X-Chat: AniDBSearch, triggered by channel text starting with .anidb, looks up the search string on AniDB and prints the corresponding AniDB entry url, or the search url if multiple results matching the search string were found. Nothing too fancy. Can also be triggered by typing /anidb.

PS: No AniDB API calls. Just HTTP fetch and some regexps.

Current: AniDBSearch 2.2

(more…)

MPCinfo X-Chat plugin, Take 2

Wednesday, December 20th, 2006

Wasn’t really that happy with the earlier version of the plugin, so I modified the mpcinfo-Sources to compile as a native Python plugin, thus eliminating the need for a DLL wrapper. This marks the my first time with the Python/C-API. Quite convenient.

The new version can be downloaded here: MPCinfo 1.3.1

There used to be C++ sources for the .pyd file and some instructions included in the archive, but I unfortunately lost the source and the original archive, so you’ll have to make do with just the essentials. ;)

MPC Status plugin for X-Chat 2

Monday, December 18th, 2006

It seems I finally got my MPCInfo plugin for X-Chat working, as far as not crashing X-Chat after a set amount of time is concerned. The point is, basically, to output the file currently playing in Media Player Classic to the current channel, similar to mIRC plugins such as GTSDll, but without all the bloat I’m not using anyway. The output currently looks like the following example, but should be fairly easy to change if you know what you’re doing.

[ TwoPoints] MPC: [Eclipse] Itadaki no Hecatetan – 01 (h264) [81CA68B4].mkv : [00:00/08:04 min (stopped)] : Size: 64.59 mb

(more…)

Apache and mod_python on Windows

Wednesday, November 29th, 2006

Just a friendly reminder for myself how to get Apache 2.2 and mod_python 3.3.x working again after I wasted almost five hours trying to get it running again after upgrading from an older version and Apache 2.0.54.

(more…)