[Python-checkins] r65249 - tracker/instances/spambayes_integration/detectors/spambayes.py

martin.v.loewis python-checkins at python.org
Sat Jul 26 17:57:35 CEST 2008


Author: martin.v.loewis
Date: Sat Jul 26 17:57:35 2008
New Revision: 65249

Log:
Skip spambayes invocation if the content is not changed.


Modified:
   tracker/instances/spambayes_integration/detectors/spambayes.py

Modified: tracker/instances/spambayes_integration/detectors/spambayes.py
==============================================================================
--- tracker/instances/spambayes_integration/detectors/spambayes.py	(original)
+++ tracker/instances/spambayes_integration/detectors/spambayes.py	Sat Jul 26 17:57:35 2008
@@ -53,6 +53,11 @@
         # Don't do anything if we're explicitly setting the score        
         return
 
+    if not newvalues.has_key('content'):
+        # No need to invoke spambayes if the content of the message
+        # is unchanged.
+        return
+
     (content, tokens) = extract_classinfo(db, klass, nodeid, newvalues)
     (success, other) = check_spambayes(db, content, tokens)
     if success:


More information about the Python-checkins mailing list