[Spambayes-checkins] spambayes/Outlook2000 manager.py,1.75,1.76
Mark Hammond
mhammond at users.sourceforge.net
Sun Aug 24 07:25:55 EDT 2003
Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1:/tmp/cvs-serv32141
Modified Files:
manager.py
Log Message:
Allow filtering to be enabled, even if no training information!
Index: manager.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** manager.py 24 Aug 2003 07:57:24 -0000 1.75
--- manager.py 24 Aug 2003 13:25:53 -0000 1.76
***************
*** 295,298 ****
--- 295,299 ----
class BayesManager:
def __init__(self, config_base="default", outlook=None, verbose=0):
+ self.never_configured = True
self.reported_error_map = {}
self.reported_startup_error = False
***************
*** 604,607 ****
--- 605,609 ----
self.config_filename = os.path.join(self.data_directory, profile_name + ".ini")
+ self.never_configured = not os.path.exists(self.config_filename)
# Now load it up
self._MergeConfigFile(self.config_filename)
***************
*** 731,751 ****
# If return is None, then it can be enabled (and indeed may be!)
# Otherwise return is the string reason
- nspam = self.classifier_data.bayes.nspam
- nham = self.classifier_data.bayes.nham
config = self.config.filter
- # For the sake of getting reasonable results, let's insist
- # on 5 spam and 5 ham messages before we can allow filtering
- # to be enabled.
- min_ham = 5
- min_spam = 5
ok_to_enable = operator.truth(config.watch_folder_ids)
if not ok_to_enable:
return "You must define folders to watch for new messages"
-
- ok_to_enable = nspam >= min_spam and nham >= min_ham
- if not ok_to_enable:
- return "There must be %d good and %d spam messages\n" \
- "trained before filtering can be enabled" \
- % (min_ham, min_spam)
ok_to_enable = operator.truth(config.spam_folder_id)
--- 733,740 ----
More information about the Spambayes-checkins
mailing list