[Spambayes] New web training interface for pop3proxy

Moore, Paul Paul.Moore@atosorigin.com
Mon Nov 25 16:36:11 2002


From: Tim Peters [mailto:tim.one@comcast.net]
> > That's true. In the meantime, can I upgrade in a way which
> > replaces the shipped DBM? If I install pybsddb, will it override
> > the standard library version? If not, can I make it? Or would
> > it be worth specifically looking for pybsddb, and using that in
> > preference if it is present?
>
> All fine questions. I can't answer them (I'm not a bsddb user --
> note that I've stuck to dicts since day #1 here <0.9 wink>). Asking
> on comp.lang.python may get better answers, but before that I'd poke
> the resources (mailing list, trackers) linked to from the project's
> home page:
>
>     http://pybsddb.sourceforge.net/
>
> "Download it and try it" is also a fine approach.

Sorry - I wasn't clear. I have pybsddb installed, it looks like it
doesn't override the standard library version automatically. It
would be nice if anydbm offered hooks to allow user extension
with new DBM lookalikes. I naively assumed anydbm would be
complicated :-) When I looked at it, though, I found it was pretty
simple. But probably not extensible, due to its reliance on
whichdb, which contains nasty magic number testing...

Just making the thing user-configurable is probably simpler.
François pointed out that dbdict used dbhash explicitly, and the
only other relevant place is hammiebulk (which imports anydbm,
but then never uses it!)

So I think that just changing dbdict to allow user customisation
of the DBM implementation should be enough.

I did a quick hack implementation (including fixing the doctests
:-)) and it looks possible, except for the fact that dumbdbm
doesn't support the required interface - specifically first() and
next() methods. But dbhash doesn't support iterkeys() :-(

Bluntly, there doesn't seem to be a usable common subset of
functionality here. At the very least, dbdict.py shouldn't be
changed to use anydbm, as it will fail when used on a system with
nothing other than dumbdbm.

And pybsddb looks even more messy. I'll think about this tonight,
and try to put together a generic interface.

Paul.



More information about the Spambayes mailing list