[spambayes-dev] Re: Pickle vs DB inconsistencies

Meyer, Tony T.A.Meyer at massey.ac.nz
Wed Jul 9 14:23:37 EDT 2003


[Sorry, this ended up being a rather long post...]

> Well, they all seem to use -d/-D, but differently.  Eg.
[...]
> This is all intensely annoying.  One clear, obvious, sensible 
> way to do it:
> 
>   <script> -d spambayes.db    # load a DBM store
>   <script> -p spambayes.pkl   # load a pickle store

I didn't look carefully enough before I posted :)  The dbExpImp swap is
a mistake, I think, and should definitely be corrected.  Which leaves
the difference as either the filename after the -d/-D or as a separate
-p option.

+1 to changing these so that they are consistent.  I'm not sure about
your suggestion - I see that -p makes sense, but so many of the scripts
use -d/-D that I wonder if that would be the better option, i.e.:

   <script> -d spambayes.db    # load a DBM store
   <script> -D spambayes.pkl   # load a pickle store

Then again, maybe everyone just uses the config file method.  What does
everyone else think?

(Note that TimS thinks that we should drop pickle support, which would
*definitely* simplify the options :)

> Also, the help for those three scripts (the only ones I've 
> looked at for this rant) are formatted inconsistently.

IIRC, there are two styles, which are reasonably consistent.  dbExpImp
is basically like pop3proxy, imapfilter and so on, and hammie[bulk],
hammiefilter, mboxtrain etc are basically alike.  No doubt as a result
of two reasonably separate sets of developers.

> You 
> might not like Optik's help formatting (I'm not always sure I 
> do), but at least it's the same for every script!

To be honest, (personally) I don't care how it's formatted.  I can see
your point, though.  I don't imagine that anyone is all that attached to
the current formatting, so if someone was willing to put in the time to
convert to optparse...

> Likewise, dbExpImp 
> could apply to any application that has a database.

This applies to all the scripts, really (i.e. pop3proxy could be any
POP3 proxy, and so on).  They make sense as long as they're in a
spambayes directory, but not once outside.  The question is what to
rename them (if they are renamed).  I suppose they could all just be
prefixed with 'spambayes' (spambayes-dbExpImp.py,
spambayes-pop3proxy.py, etc).

[Separating dbExpImp into export and import]
> (Note that I said "one command", not "one script".  From a 
> Unix perspective, it would make perfect sense to have one 
> script, and make sb-export and sb-import both symlinks to it. 

No doubt this is my Windows-ness showing, but I don't understand the
difference between a command and a script.  Do you mean that
sb-export/sb-import are little scripts that import dbExpImp.py (or
whatever it gets called) and call the appropriate function?  Or do you
mean that sb-export/sb-import call dbExpImp.py with options that make it
do the right thing?

> Dunno how Windows people deal with that sort of thing.)

If either of the above are right then either (respectively) the same
way, or by creating a shortcut, I suppose.  Or more realistically, by
creating a GUI to go over the top of it :)

> The script names are also terrible.  hammie.py might have 
> made a cute sort of sense nine months ago when this was Tim's 
> play project, but now it's sitting in /usr/local/bin and what 
> the *hell* does "hammie" mean? Nothing!

It still kinda is cute ;)  Plus no-one has suggested an alterative
name...

> Come to think of it, 
> hammiesrv.py, hammiefilter.py, and hammiecli.py are almost as bad.

You think that sb-server, sb-filter and sb-client are better names?

> Or spambayes could it include its own optparse.py (the 
> preferred name for forwards compatibility with Python 2.3: 
> setup.py should just neglect to install optparse.py if run by 
> Python 2.3).  Docutils and SCons already do just that.

Can the 2.3 optparse module just be dropped into a 2.2 setup?  (BTW, why
can I import optparse in 2.2.3 when the doc says it only arrives in
2.3?)
 
> Please take this as constructive criticism rather than just 
> bitching.

I definitely am.  Please don't take my disagreements (if any) as an
unwillingness to see flaws - I just like to discuss things first :)

> One of these days I'm just going to sit down and 
> write a bunch of sb-* scripts, so I can put the brain cells 
> currently occupied with trying to remember what -D means for 
> which script to some better use.  

Note that as someone else said, you could just setup a config file that
has the relevant information, unless there are problems with that
approach.

> And I would very much like 
> to check them into spambayes' CVS, unless someone beats me to it.

I think deployment is really something that should be looked at at the
moment.  Mark & I have both mentioned creating windows installers for
the various apps (it would be nice if someone followed them with mac
versions...), and I suppose this is basically the *nix equivilant.

=Tony Meyer



More information about the spambayes-dev mailing list