[Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py,
1.19, 1.20
Mark Hammond
mhammond at users.sourceforge.net
Sun Aug 24 07:22:09 EDT 2003
Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs
In directory sc8-pr-cvs1:/tmp/cvs-serv31423
Modified Files:
dialog_map.py
Log Message:
Now that we allow SpamBayes to be enabled without training information,
reflect what this means in the dialog.
Index: dialog_map.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** dialog_map.py 24 Aug 2003 12:01:52 -0000 1.19
--- dialog_map.py 24 Aug 2003 13:22:06 -0000 1.20
***************
*** 35,40 ****
nspam = bayes.nspam
nham = bayes.nham
! if nspam > 0 and nham > 0:
db_status = "Database has %d good and %d spam" % (nham, nspam)
else:
db_status = "Database has no training information"
--- 35,42 ----
nspam = bayes.nspam
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"
***************
*** 42,45 ****
--- 44,63 ----
0, db_status)
+ class WizardTrainingStatusProcessor(ControlProcessor):
+ def Init(self):
+ bayes = self.window.manager.classifier_data.bayes
+ nspam = bayes.nspam
+ nham = bayes.nham
+ if nspam > 10 and nham > 10:
+ msg = "SpamBayes has been successfully trained and configured. " \
+ "You should find the system is immediately effective at " \
+ "filtering spam."
+ else:
+ msg = "SpamBayes has been successfully trained and configured. " \
+ "However, as the number of messages trained is quite small, " \
+ "SpamBayes may take some time to become truly effective."
+ win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT,
+ 0, msg)
+
class IntProcessor(OptionControlProcessor):
def UpdateControl_FromValue(self):
***************
*** 133,137 ****
return
if not manager.config.filter.enabled:
! status = "Filtering is disabled. Select 'Enable Filtering' to enable"
win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT,
0, status)
--- 151,155 ----
return
if not manager.config.filter.enabled:
! status = "Filtering is disabled. Select 'Enable SpamBayes' to enable"
win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT,
0, status)
***************
*** 496,499 ****
--- 514,518 ----
),
"IDD_WIZARD_FINISHED_TRAINED": (
+ (WizardTrainingStatusProcessor, "IDC_TRAINING_STATUS"),
),
"IDD_WIZARD_FINISHED_TRAIN_LATER" : (
More information about the Spambayes-checkins
mailing list