[Spambayes-checkins] spambayes pop3proxy.py,1.22,1.23

Tim Stone timstone4@users.sourceforge.net
Tue Nov 26 04:27:21 2002


Update of /cvsroot/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv11550

Modified Files:
	pop3proxy.py 
Log Message:
Corrected reference to __slots__ in word query.

Index: pop3proxy.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** pop3proxy.py	26 Nov 2002 03:32:11 -0000	1.22
--- pop3proxy.py	26 Nov 2002 04:27:19 -0000	1.23
***************
*** 1099,1112 ****
          word = word.lower()
          try:
-             # Must be a better way to get __dict__ for a new-style class...
              wi = state.bayes.wordinfo[word]
!             members = dict(map(lambda n: (n, getattr(wi, n)), wi.__slots__))
!             members['atime'] = time.asctime(time.localtime(members['atime']))
              info = """Number of spam messages: <b>%(spamcount)d</b>.<br>
                     Number of ham messages: <b>%(hamcount)d</b>.<br>
-                    Number of times used to classify: <b>%(killcount)s</b>.<br>
                     Probability that a message containing this word is spam:
!                    <b>%(spamprob)f</b>.<br>
!                    Last used: <b>%(atime)s</b>.<br>""" % members
          except KeyError:
              info = "%r does not appear in the database." % word
--- 1099,1109 ----
          word = word.lower()
          try:
              wi = state.bayes.wordinfo[word]
!             members = wi.__dict__
!             members['spamprob'] = state.bayes.probability(wi)
              info = """Number of spam messages: <b>%(spamcount)d</b>.<br>
                     Number of ham messages: <b>%(hamcount)d</b>.<br>
                     Probability that a message containing this word is spam:
!                    <b>%(spamprob)f</b>.<br>""" % members
          except KeyError:
              info = "%r does not appear in the database." % word





More information about the Spambayes-checkins mailing list