summaryrefslogtreecommitdiff
path: root/posts/pqm.mdwn
blob: b4b2a442326517a555fa8473f8cf8a34d795e030 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
[[!meta title="arch-pqm requires python 2.3…"]]
[[!meta author="Daniel Silverstone"]]
[[!meta date="2004-11-29 23:22:32 +0000"]]
[[!tag tech]]

…or python 2.2 and a lot of tickling.

I checked out the latest
<a href="http://web.verbum.org/arch-pqm/">arch-pqm</a> from Colin
Walter’s repository and proceeded to try and get a PQM going on my
server. I needed to get this to work without any .forward or .procmailrc
magic so I started by writing a little tool to fetch emails from a POP3
account and write them to files.

Then I had to get arch-pqm working. Now arch-pqm claims to require
python2.3 so I set about trying to persuade it that 2.2 isn’t so bad and
maybe it should get on with it. The easiest bit was the argument parser
had a broken <code>foo in (bar)</code> test which I stomped on.

But then came the joy of <code>os.walk()</code> which isn’t in python2.2
so a little hack-fest later and I created <code>os_walk()</code> which
behaves pretty much the same and works in python2.2.

    def os_walk(path,topdown=True):
        l = []
        def fooble(l,dir,ents):
           ds = []
           fs = []
           for e in ents:
               if os.path.isdir("%s/%s" % (dir,e)):
                   ds.append(e)
               else:
                   fs.append(e)
           if topdown:
               l.append((dir,ds,fs))
           else:
               l.insert(0,(dir,ds,fs))
        os.path.walk(path,fooble,l)
        return l

Perhaps that’ll be useful to anyone else trying to get arch-pqm working
on a woody box.

Now to submit merge requests to it. <code>o/</code>