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

Modified Files:
        message.py 
Log Message:
Stats.CalculatePersistentStats tests for old-format messages in the message
info database by checking if the date_modified attribute of the message is
None.  Unfortunately, old-format messages didn't even have a date_modified
attribute, which caused an error as soon as the from_date of the Stats
object was set to a non-None value.  Correct this by always initializing
date_modified to None in the Message.__init__ function.


Index: message.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** message.py  21 Dec 2004 23:12:11 -0000      1.64
--- message.py  22 Dec 2004 18:37:36 -0000      1.65
***************
*** 171,175 ****
      def store_msg(self, msg):
          if self.db is not None:
!             attributes = [("date_modified", time.time())]
              for att in msg.stored_attributes:
                  attributes.append((att, getattr(msg, att)))
--- 171,176 ----
      def store_msg(self, msg):
          if self.db is not None:
!             msg.date_modified = time.time()
!             attributes = []
              for att in msg.stored_attributes:
                  attributes.append((att, getattr(msg, att)))
***************
*** 288,296 ****
              nm, typ = database_type()
              self.message_info_db = open_storage(nm, typ)
!         self.stored_attributes = ['c', 't',]
          self.getDBKey = self.getId
          self.id = None
          self.c = None
          self.t = None
  
          if id is not None:
--- 289,298 ----
              nm, typ = database_type()
              self.message_info_db = open_storage(nm, typ)
!         self.stored_attributes = ['c', 't', 'date_modified', ]
          self.getDBKey = self.getId
          self.id = None
          self.c = None
          self.t = None
+         self.date_modified = None
  
          if id is not None:

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

Reply via email to