Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15578/Outlook2000

Modified Files:
        filter.py manager.py 
Log Message:
Only store the classification of the message in the messageinfo db if 
'all_actions'
 is true.  This does not include using the spam/not spam buttons, which is 
necessary
 because otherwise our statistics will always reflect corrected results, not 
the initial
 ones.

Use constants for the classification strings to avoid problems with people 
changing
 option values when they shouldn't.

Index: filter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/filter.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** filter.py   23 Dec 2004 01:50:47 -0000      1.45
--- filter.py   23 Dec 2004 02:05:14 -0000      1.46
***************
*** 17,31 ****
          disposition = "Yes"
          attr_prefix = "spam"
!         msg.c = mgr.bayes_options["Headers", "header_spam_string"][0]
      elif prob_perc >= config.unsure_threshold:
          disposition = "Unsure"
          attr_prefix = "unsure"
!         msg.c = mgr.bayes_options["Headers", "header_unsure_string"][0]
      else:
          disposition = "No"
          attr_prefix = "ham"
!         msg.c = mgr.bayes_options["Headers", "header_ham_string"][0]
!     mgr.classifier_data.message_db.store_msg(msg)
!     mgr.classifier_data.dirty = True
  
      ms = mgr.message_store
--- 17,32 ----
          disposition = "Yes"
          attr_prefix = "spam"
!         if all_actions:
!             msg.c = mgr.bayes_message.PERSISTENT_SPAM_STRING
      elif prob_perc >= config.unsure_threshold:
          disposition = "Unsure"
          attr_prefix = "unsure"
!         if all_actions:
!             msg.c = mgr.bayes_message.PERSISTENT_UNSURE_STRING
      else:
          disposition = "No"
          attr_prefix = "ham"
!         if all_actions:
!             msg.c = mgr.bayes_message.PERSISTENT_HAM_STRING
  
      ms = mgr.message_store
***************
*** 49,53 ****
                          if all_actions:
                              msg.RememberMessageCurrentFolder()
-                             mgr.classifier_data.message_db.store_msg(msg)
                          msg.Save()
                          break
--- 50,53 ----
***************
*** 111,114 ****
--- 111,116 ----
          if all_actions:
              mgr.stats.RecordClassification(prob)
+             mgr.classifier_data.message_db.store_msg(msg)
+             mgr.classifier_data.dirty = True
          return disposition
      except:

Index: manager.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v
retrieving revision 1.105
retrieving revision 1.106
diff -C2 -d -r1.105 -r1.106
*** manager.py  22 Dec 2004 01:22:00 -0000      1.105
--- manager.py  23 Dec 2004 02:05:14 -0000      1.106
***************
*** 456,459 ****
--- 456,460 ----
              self.classifier_data.InitNew()
          self.bayes_options = bayes_options
+         self.bayes_message = bayes_message
          bayes_options["Categorization", "spam_cutoff"] = \
                                          self.config.filter.spam_threshold \

_______________________________________________
Spambayes-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-checkins

Reply via email to