[Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.4,1.5

Sjoerd Mullender sjoerd at users.sourceforge.net
Mon Sep 8 05:09:27 EDT 2003


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

Modified Files:
	sb_imapfilter.py 
Log Message:
Count all messages being classified instead of just the ones from the last folder.

Index: sb_imapfilter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sb_imapfilter.py	8 Sep 2003 09:19:44 -0000	1.4
--- sb_imapfilter.py	8 Sep 2003 11:09:25 -0000	1.5
***************
*** 644,648 ****
          if options["globals", "verbose"]:
              t = time.time()
!             count = None
  
          # Select the spam folder and unsure folder to make sure they exist
--- 644,651 ----
          if options["globals", "verbose"]:
              t = time.time()
!         count = {}
!         count["ham"] = 0
!         count["spam"] = 0
!         count["unsure"] = 0
  
          # Select the spam folder and unsure folder to make sure they exist
***************
*** 654,659 ****
              imap.SelectFolder(filter_folder)
              folder = IMAPFolder(filter_folder)
!             count = folder.Filter(self.classifier, self.spam_folder,
                            self.unsure_folder)
   
          if options["globals", "verbose"]:
--- 657,664 ----
              imap.SelectFolder(filter_folder)
              folder = IMAPFolder(filter_folder)
!             subcount = folder.Filter(self.classifier, self.spam_folder,
                            self.unsure_folder)
+             for key in count.keys():
+                 count[key] += subcount.get(key, 0)
   
          if options["globals", "verbose"]:





More information about the Spambayes-checkins mailing list