[Spambayes-checkins] spambayes/spambayes message.py,1.40,1.41

Sjoerd Mullender sjoerd at acm.org
Wed Nov 26 05:39:56 EST 2003


Richie Hindle wrote:
> Update of /cvsroot/spambayes/spambayes/spambayes
> In directory sc8-pr-cvs1:/tmp/cvs-serv19794
> 
> Modified Files:
> 	message.py 
> Log Message:
> Patch 831388: Make message.py respect the header_score_digits option.
> 
> Bugfix candidate (probably).
> 
> 
> Index: message.py
> ===================================================================
> RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v
> retrieving revision 1.40
> retrieving revision 1.41
> diff -C2 -d -r1.40 -r1.41
> *** message.py	8 Oct 2003 04:04:35 -0000	1.40
> --- message.py	25 Nov 2003 23:11:18 -0000	1.41
> ***************
> *** 342,346 ****
>   
>           if options['Headers','include_score']:
> !             disp = str(prob)
>               if options["Headers", "header_score_logarithm"]:
>                   if prob<=0.005 and prob>0.0:
> --- 342,346 ----
>   
>           if options['Headers','include_score']:
> !             disp = ("%."+str(options["Headers", "header_score_digits"])+"f") % prob
>               if options["Headers", "header_score_logarithm"]:
>                   if prob<=0.005 and prob>0.0:
> 

This can be done with
disp = "%.*f" % (options["Headers", "header_score_digits"], prob)
which looks more readable to me.

-- 
Sjoerd Mullender <sjoerd at acm.org>



More information about the Spambayes-checkins mailing list