[Spambayes] OptionsClass.update_file doesn't create a new file

Meyer, Tony T.A.Meyer at massey.ac.nz
Tue Jul 29 19:47:53 EDT 2003


> Or there's a problem with the programmer who doesn't understand.
> 
> Sorry, I had thought that update_file would write out all 
> sections, even if they were not changed. But that's not the case. 

Sorry, the docstring should be clearer there.  The intent is to only
write those that have changed from the default - so that you end up with
a minimal set, which means if a default changes, then it changes for you
unless you have previously touched it.  The UpdateableConfigParser class
I originally wrote that had the update_file function in it made this
clear, but that bit of documentation apparently got lost along the way.

> I'm trying to create a .ini file that has all the defaults 
> and the text explanation of each section.

If you do:
>>> from spambayes.Options import options
>>> print options.display_full()
You'll get all this information, although not in an .ini file format.
If you do:
>>> from spambayes.Options import options
>>> print options.display()
You'll get *all* the options in an .ini file format, but not the text
explanation. (You can use options.write() to put this straight in a
file).

To get both (with the text explanation in a comment, I presume), you'll
have to write your own function.  Should be easy enough based on the
combination of the above, though.

=Tony Meyer



More information about the Spambayes mailing list