[Spambayes-checkins] spambayes/spambayes Histogram.py, 1.2, 1.3 Tester.py, 1.2, 1.3 message.py, 1.34, 1.35

Tony Meyer anadelonbrin at users.sourceforge.net
Thu Sep 4 19:25:29 EDT 2003


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

Modified Files:
	Histogram.py Tester.py message.py 
Log Message:
Missed some options cleanup.

sb-server, sb-smtpproxy, sb-imapfilter, timtest and timcv all appear to work now.  This should at least mean that the core does.

Index: Histogram.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Histogram.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Histogram.py	14 Jan 2003 05:38:20 -0000	1.2
--- Histogram.py	5 Sep 2003 01:25:27 -0000	1.3
***************
*** 18,22 ****
      # Note:  nbuckets can be passed for backward compatibility.  The
      # display() method can be passed a different nbuckets value.
!     def __init__(self, nbuckets=options.nbuckets,  lo=0.0, hi=100.0):
          self.lo, self.hi = lo, hi
          self.nbuckets = nbuckets
--- 18,23 ----
      # Note:  nbuckets can be passed for backward compatibility.  The
      # display() method can be passed a different nbuckets value.
!     def __init__(self, nbuckets=options["TestDriver", "nbuckets"],
!                  lo=0.0, hi=100.0):
          self.lo, self.hi = lo, hi
          self.nbuckets = nbuckets
***************
*** 76,80 ****
          # Compute percentiles.
          self.pct = pct = []
!         for p in options.percentiles:
              assert 0.0 <= p <= 100.0
              # In going from data index 0 to index n-1, we move n-1 times.
--- 77,81 ----
          # Compute percentiles.
          self.pct = pct = []
!         for p in options["TestDriver", "percentiles"]:
              assert 0.0 <= p <= 100.0
              # In going from data index 0 to index n-1, we move n-1 times.

Index: Tester.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Tester.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Tester.py	14 Jan 2003 05:38:20 -0000	1.2
--- Tester.py	5 Sep 2003 01:25:27 -0000	1.3
***************
*** 93,98 ****
              if callback:
                  callback(example, prob)
!             is_ham_guessed  = prob <  options.ham_cutoff
!             is_spam_guessed = prob >= options.spam_cutoff
              if is_spam:
                  self.nspam_tested += 1
--- 93,98 ----
              if callback:
                  callback(example, prob)
!             is_ham_guessed  = prob <  options["Categorization", "ham_cutoff"]
!             is_spam_guessed = prob >= options["Categorization", "spam_cutoff"]
              if is_spam:
                  self.nspam_tested += 1
***************
*** 152,156 ****
      >>> from spambayes.classifier import Bayes
      >>> from spambayes.Options import options
!     >>> options.ham_cutoff = options.spam_cutoff = 0.5
  
      >>> good1 = _Example('', ['a', 'b', 'c'])
--- 152,156 ----
      >>> from spambayes.classifier import Bayes
      >>> from spambayes.Options import options
!     >>> options["Categorization", "ham_cutoff"] = options["Categorization", "spam_cutoff"] = 0.5
  
      >>> good1 = _Example('', ['a', 'b', 'c'])

Index: message.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** message.py	26 Aug 2003 06:49:56 -0000	1.34
--- message.py	5 Sep 2003 01:25:27 -0000	1.35
***************
*** 266,270 ****
      def setIdFromPayload(self):
          try:
!             self.setId(self[options['pop3proxy','mailid_header_name']])
          except ValueError:
              return None
--- 266,270 ----
      def setIdFromPayload(self):
          try:
!             self.setId(self[options['Headers','mailid_header_name']])
          except ValueError:
              return None
***************
*** 336,340 ****
  
          if options['Headers','add_unique_id']:
!             self[options['pop3proxy','mailid_header_name']] = self.id
  
      def delSBHeaders(self):
--- 336,340 ----
  
          if options['Headers','add_unique_id']:
!             self[options['Headers','mailid_header_name']] = self.id
  
      def delSBHeaders(self):





More information about the Spambayes-checkins mailing list