Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2198/Outlook2000
Modified Files:
addin.py filter.py msgstore.py
Log Message:
Must save message after remembering the folder.
Report the last modified date in the "show clues" message. I'm not sure this
is the
best way to put it, but I'll think more about it and change it if I come up
with
something better. Feel free to think of something yourself!
Save classifier_data if it is dirty.
Add modified_date to the persistent attributes now that it's not automatically
stored.
Index: addin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v
retrieving revision 1.149
retrieving revision 1.150
diff -C2 -d -r1.149 -r1.150
*** addin.py 27 Dec 2004 02:26:28 -0000 1.149
--- addin.py 29 Dec 2004 06:22:24 -0000 1.150
***************
*** 469,472 ****
--- 469,484 ----
push("# ham trained on: %d<br>\n" % c.nham)
push("# spam trained on: %d<br>\n" % c.nspam)
+ push("<br>\n")
+
+ # Report last modified date.
+ modified_date = msgstore_message.date_modified
+ if modified_date:
+ from time import localtime, strftime
+ modified_date = localtime(modified_date)
+ date_string = strftime("%a, %d %b %Y %I:%M:%S %p", modified_date)
+ push("As at %s:<br>\n" % (date_string,))
+ else:
+ push("The last time this message was classified or trained:<br>\n")
+
# Score when the message was classified - this will hopefully help
# people realise that it may not necessarily be the same, and will
***************
*** 482,497 ****
else:
original_class = "good"
- push("<br>\n")
if original_score is None:
! push("This message has not been filtered.")
else:
original_score = round(original_score)
! push("When this message was last filtered, it was classified " \
! "as %s (it scored %d%%)." % (original_class, original_score))
# Report whether this message has been trained or not.
push("<br>\n")
! push("This message has %sbeen trained%s." % \
{False : ("", " as ham"), True : ("", " as spam"),
None : ("not ", "")}[msgstore_message.t])
# Format the clues.
push("<h2>%s Significant Tokens</h2>\n<PRE>" % len(clues))
--- 494,509 ----
else:
original_class = "good"
if original_score is None:
! push("This message had not been filtered.")
else:
original_score = round(original_score)
! push("This message was classified as %s (it scored %d%%)." % \
! (original_class, original_score))
# Report whether this message has been trained or not.
push("<br>\n")
! push("This message had %sbeen trained%s." % \
{False : ("", " as ham"), True : ("", " as spam"),
None : ("not ", "")}[msgstore_message.t])
+
# Format the clues.
push("<h2>%s Significant Tokens</h2>\n<PRE>" % len(clues))
***************
*** 697,700 ****
--- 709,713 ----
# it was after filtering, or has never been filtered.
msgstore_message.RememberMessageCurrentFolder()
+ msgstore_message.Save()
# Must train before moving, else we lose the message!
subject = msgstore_message.GetSubject()
Index: filter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/filter.py,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** filter.py 23 Dec 2004 02:05:14 -0000 1.46
--- filter.py 29 Dec 2004 06:22:31 -0000 1.47
***************
*** 113,116 ****
--- 113,117 ----
mgr.classifier_data.message_db.store_msg(msg)
mgr.classifier_data.dirty = True
+ mgr.classifier_data.SavePostIncrementalTrain()
return disposition
except:
Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.98
retrieving revision 1.99
diff -C2 -d -r1.98 -r1.99
*** msgstore.py 22 Dec 2004 01:22:00 -0000 1.98
--- msgstore.py 29 Dec 2004 06:22:31 -0000 1.99
***************
*** 809,813 ****
# For use with the spambayes.message messageinfo database.
! self.stored_attributes = ['c', 't', 'original_folder']
self.t = None
self.c = None
--- 809,814 ----
# For use with the spambayes.message messageinfo database.
! self.stored_attributes = ['c', 't', 'original_folder',
! 'date_modified']
self.t = None
self.c = None
_______________________________________________
Spambayes-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-checkins