[spambayes-dev] Script to find which db is used

Meyer, Tony T.A.Meyer at massey.ac.nz
Wed Jul 30 12:08:40 EDT 2003


> This is a little script to find out which database is used by 
> pop3proxy since it is better to avoid using dumbdb. The script is
based 
> on a mail sent by Skip to me.
> 
> Lots of people (At least one... i.e. me) did not know which database 
> they use. This can help them.

This is a nice little utility.  I'll check it in and put a link to it on
the website.

> Since this is my first python script I have a question
> I think this script should be in
> c:/a_dir/spambayes/utilities
> but how can you import the options from spambayes.Options 
> when your are in c:/a_dir/spambayes/utilities.

If spambayes is on your PYTHONPATH then it will just work.  If it's not,
then you need to add the spambayes directory to sys.path.  Some of the
testing scripts do this (timtest.py and timcv.py do, I think).  For
example:

"""
import os
import sys

sys.path.insert(-1, os.getcwd()) # add this directory
sys.path.insert(-1, os.path.dirname(os.getcwd())) # add the parent
directory
"""

=Tony Meyer



More information about the spambayes-dev mailing list