[Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py,
1.30, 1.31
Mark Hammond
mhammond at users.sourceforge.net
Thu Aug 28 18:12:45 EDT 2003
Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs
In directory sc8-pr-cvs1:/tmp/cvs-serv25214/dialogs
Modified Files:
dialog_map.py
Log Message:
Patch from Kenny Pitt to prevent us enabling spambayes before filtering
is set up (but you *can* enable before training is complete). Also
Tweaks of the status text.
Index: dialog_map.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** dialog_map.py 27 Aug 2003 05:30:05 -0000 1.30
--- dialog_map.py 29 Aug 2003 00:12:43 -0000 1.31
***************
*** 36,44 ****
nham = bayes.nham
if nspam > 10 and nham > 10:
! db_status = "Database has %d good and %d spam" % (nham, nspam)
elif nspam > 0 or nham > 0:
! db_status = "Database only has %d good and %d spam - you should consider performing additional training" % (nham, nspam)
else:
! db_status = "Database has no training information"
win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT,
0, db_status)
--- 36,47 ----
nham = bayes.nham
if nspam > 10 and nham > 10:
! db_status = "Database has %d good and %d spam." % (nham, nspam)
elif nspam > 0 or nham > 0:
! db_status = "Database only has %d good and %d spam - you should " \
! "consider performing additional training." % (nham, nspam)
else:
! db_status = "Database has no training information. SpamBayes " \
! "will deliver all messages to your 'Unsure' folder, " \
! "ready for you to classify."
win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT,
0, db_status)
***************
*** 83,86 ****
--- 86,97 ----
class FilterEnableProcessor(BoolButtonProcessor):
+ def OnOptionChanged(self, option):
+ self.Init()
+
+ def Init(self):
+ BoolButtonProcessor.Init(self)
+ reason = self.window.manager.GetDisabledReason()
+ win32gui.EnableWindow(self.GetControl(), reason is None)
+
def UpdateValue_FromControl(self):
check = win32gui.SendMessage(self.GetControl(), win32con.BM_GETCHECK)
More information about the Spambayes-checkins
mailing list