blog.rupamsunyata.org

Decklin’s excuse for some blogging software. Est. 2006.

The cradle rocks above an abyss

In related news: with sup out of the way, I have returned to packaging Mnemosyne, the program that powers this blog. It is also in NEW, so expect to see it soon. (Like sup, which is packaged as sup-mail since sup is the Software Update Protocol, it is mnemosyne-blog since mnemosyne is the program formerly known as PyQt MemAid.)

If you're just joining us, Mnemosyne compiles a Maildir into a static site. You can use it for a blog or just about anything else where a traditional CMS would be overkill. It's all XML and Python-extensible. The documentation kind of sucks, though, so I'm also hoping I get some more users from this to tell me what to fix. It hasn't otherwise seen much action since the beginning of 2006. Drop me a line if you have any feedback!

(If it's not obvious, I think blog "comments" in general are pretty worthless. But with some craftiness, they could certainly be implemented within Mnemosyne as it stands. As could a general mailing list archive, etc...)

When mayonnaise goes bad

This is is a wonderful metaphor: "looking in the fridge every few minutes and hoping that something tasty will appear".

I may be thick, but Planet does not appear to store any information about how often a feed ought to be polled (my blog seems to be hit every 20 minutes even when I'm AWOL). I use rawdog, which does.

When adding a feed, I make a vague guess at how often I want to poll it, and then periodically adjust the time based on how often updates actually happened. This is done with a terrible, awful, ugly hack that reads the database[1] and spits out the config file with new-and-improved times. Pretty dumb, but good enough "for now" (apparently I haven't touched it in over a year).

rawdog will also automatically update feed locations if given a 301. Since it already rewrites the config for that, I might try to merge time updating into the core someday, but no one has demanded such a feature AFAIK.

[1]And by "database", I mean "pickle", since Adam doesn't want any fancy dependencies. Despite how slow this ought to be, the combination of optimized (such as it is) feed-polling and ever-faster CPUs in my web servers have made it fast enough for me not to care.

Not a good thing to encounter in a daemon

  File "/usr/lib/python2.3/urllib.py", line 787, in __init__
    self.read = self.fp.read
AttributeError: 'NoneType' object has no attribute 'read'

Sigh. I believe this is how Joe feels all the time, only much less so.

Mnemosyne 0.9

Alrighty, the example blog really works again. I should spend some time on making some interesting “themes” now, probably, but I really hate making themes. Web “design” in general really.

See what I said here, really. I’ve never been entirely sure if that page is supposed to be something you should read if your attitude needs adjusting, or if my attitude needs adjusting. Probably both. (“The Pope and I can take it, but don’t pick on Pat Buchanan...”)

What I really ought to do is kill that stupid S2 friends-view layout I have, but, yuck. S2.

It's called cat, because, you know, dog...

Okay, I think the tag plugin is done.

Whoo

So I’ve gotten the roux rewrite running, finally. Not doing anything useful, but running. I can’t believe I was using a pull parser and generating the Atom 0.3 by hand(!) before. Ugh. Totally, completely, hideously embarrassing.

Anyway last time I got distracted on the way to making it useful and just said “screw this, I’ll put some regular expression crap in” and it’s been hobbling along on that (basically no better than the million other screen-scrapers out there). But. I had a brainwave about how to implement what I was really looking for (the “civilized” bit), which works on simple cases at this point; I just need to think about making it extendible. Should be fun.

Enabling domain-specific languages seems to be a theme with all this recent stuff. I don’t know why.

I got lost

You know it’s bad when writing several screenfuls of recursive fuzzy tree matcher in Python is fun and doing a tiny bit of tree and Makefile maintenance on a C project so you can push out fixes from last year is a chore you’ve been putting off for weeks.

Hate

I truly, truly hate email. First you have the __getitem__ and __setitem__ that work nothing like a dict (no KeyError ever, just returns None, despite there being a get, silently fails to overwrite an existing value, no update). But of course they're just as stupid as a dict if you change the content, instead of associating the type with that object. And then. decode_header. Does this:

[('Foo', 'utf-8'), ('Bar', None)]

Hint: ('Bar', None) is not a valid list of arguments for creating a unicode object. I don’t even want to create it myself. I just want the thing decoded. Ugh, ugh, ugh. Everything that possibly could have sucked here has sucked. Lots.

One of the reasons I decided to use Maildir is because it takes two lines of code to turn it into a structured list of objects. Except of course both of the standard modules that make that possible are horribly designed. I really don’t want to reimplement this shit. I really don’t want to go to a “real” database backend where suddenly you can't use any standard unix tools to do anything and you have to write them all from scratch.

All software sucks. Down, not across.

Generated by Mnemosyne 0.12.