[Python-checkins] r55875 - tracker/instances/python-dev/detectors/spamcheck.py

skip.montanaro python-checkins at python.org
Mon Jun 11 04:29:45 CEST 2007


Author: skip.montanaro
Date: Mon Jun 11 04:29:41 2007
New Revision: 55875

Modified:
   tracker/instances/python-dev/detectors/spamcheck.py
Log:
Audit issues as well as files.  Do I need to audit "msg" as well?  Also, in
case it gets logged somewhere, note why we rejected those items we did.


Modified: tracker/instances/python-dev/detectors/spamcheck.py
==============================================================================
--- tracker/instances/python-dev/detectors/spamcheck.py	(original)
+++ tracker/instances/python-dev/detectors/spamcheck.py	Mon Jun 11 04:29:41 2007
@@ -36,9 +36,11 @@
         pass
     else:
         if prob >= SPAM_CUTOFF:
-            raise Reject
+            raise Reject("Looks like spam to me - prob=%.3f" % prob)
 
 def init(database):
     """Initialize auditor."""
+    database.issue.audit('create', check_spam)
+    database.issue.audit('set', check_spam)
     database.file.audit('create', check_spam)
     database.file.audit('set', check_spam)


More information about the Python-checkins mailing list