[Spambayes-checkins] spambayes/spambayes message.py,1.65,1.66

Tony Meyer anadelonbrin at users.sourceforge.net
Thu Dec 23 03:06:27 CET 2004


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

Modified Files:
	message.py 
Log Message:
Provide constants for the persistent ham/spam/unsure stings for the messageinfo db.

Index: message.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** message.py	22 Dec 2004 18:37:36 -0000	1.65
--- message.py	23 Dec 2004 02:06:21 -0000	1.66
***************
*** 113,116 ****
--- 113,119 ----
  
  STATS_START_KEY = "Statistics start date"
+ PERSISTENT_HAM_STRING = 'h'
+ PERSISTENT_SPAM_STRING = 's'
+ PERSISTENT_UNSURE_STRING = 'u'
  
  class MessageInfoBase(object):
***************
*** 372,380 ****
  
      def GetClassification(self):
!         if self.c == 's':
              return options['Headers','header_spam_string']
!         elif self.c == 'h':
              return options['Headers','header_ham_string']
!         elif self.c == 'u':
              return options['Headers','header_unsure_string']
          return None
--- 375,383 ----
  
      def GetClassification(self):
!         if self.c == PERSISTENT_SPAM_STRING:
              return options['Headers','header_spam_string']
!         elif self.c == PERSISTENT_HAM_STRING:
              return options['Headers','header_ham_string']
!         elif self.c == PERSISTENT_UNSURE_STRING:
              return options['Headers','header_unsure_string']
          return None
***************
*** 385,393 ****
  
          if cls == options['Headers','header_spam_string']:
!             self.c = 's'
          elif cls == options['Headers','header_ham_string']:
!             self.c = 'h'
          elif cls == options['Headers','header_unsure_string']:
!             self.c = 'u'
          else:
              raise ValueError, \
--- 388,396 ----
  
          if cls == options['Headers','header_spam_string']:
!             self.c = PERSISTENT_SPAM_STRING
          elif cls == options['Headers','header_ham_string']:
!             self.c = PERSISTENT_HAM_STRING
          elif cls == options['Headers','header_unsure_string']:
!             self.c = PERSISTENT_UNSURE_STRING
          else:
              raise ValueError, \



More information about the Spambayes-checkins mailing list