From mhammond at users.sourceforge.net Sun Aug 3 08:15:50 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 10:15:54 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 config.py,1.18,1.19 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv23303 Modified Files: config.py Log Message: Add lots of doc strings to the options (the reason should become clear soon . Also add a "rebuild" option to correspond with the checkbox on the training dialog. Index: config.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/config.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** config.py 29 Jul 2003 01:24:34 -0000 1.18 --- config.py 3 Aug 2003 14:15:48 -0000 1.19 *************** *** 162,166 **** BOOLEAN, RESTORE), ("rescore", "Rescore message after training?", True, ! """State of the 'rescore' button""", BOOLEAN, RESTORE), ), --- 162,176 ---- BOOLEAN, RESTORE), ("rescore", "Rescore message after training?", True, ! """After the training has completed, should all the messages be ! scored for their Spam value. This is particularly useful after ! your initial training runs, so you can see how effective your ! sorting of spam and ham was.""", ! BOOLEAN, RESTORE), ! ("rebuild", "Rescore message after training?", True, ! """Should the entire database be rebuilt? If enabled, then all ! training information is reset, and a complete new database built ! from the existing messages in your folders. If disabled, then only ! new messages in the folders that have not previously been trained ! on will be processed""", BOOLEAN, RESTORE), ), *************** *** 220,224 **** "Filter_Now": ( (FolderIDOption, "folder_ids", "Folders to filter in a 'Filter Now' operation", [], ! """""", FOLDER_ID, DO_NOT_RESTORE), ("include_sub", "Does the nominated folders include sub-folders?", False, --- 230,234 ---- "Filter_Now": ( (FolderIDOption, "folder_ids", "Folders to filter in a 'Filter Now' operation", [], ! """The list of folders that will be filtered by this process.""", FOLDER_ID, DO_NOT_RESTORE), ("include_sub", "Does the nominated folders include sub-folders?", False, *************** *** 226,230 **** BOOLEAN, DO_NOT_RESTORE), ("only_unread", "Only filter unread messages?", False, ! """""", BOOLEAN, RESTORE), ("only_unseen", "Only filter previously unseen ?", False, --- 236,240 ---- BOOLEAN, DO_NOT_RESTORE), ("only_unread", "Only filter unread messages?", False, ! """When scoring messages, should only messages that are unread be considered?""", BOOLEAN, RESTORE), ("only_unseen", "Only filter previously unseen ?", False, *************** *** 232,236 **** BOOLEAN, RESTORE), ("action_all", "Perform all filter actions?", True, ! """""", BOOLEAN, RESTORE), ), --- 242,248 ---- BOOLEAN, RESTORE), ("action_all", "Perform all filter actions?", True, ! """When scoring the messages, should all items be performed (such as ! moving the items based on the score) or should the items only be scored, ! but otherwise untouched.""", BOOLEAN, RESTORE), ), From mhammond at users.sourceforge.net Sun Aug 3 16:22:40 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 18:22:46 2003 Subject: [Spambayes-checkins] spambayes/spambayes OptionsClass.py,1.5,1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv29324 Modified Files: OptionsClass.py Log Message: Add a get_option method, so the option instance itself can be fetched. Index: OptionsClass.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/OptionsClass.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OptionsClass.py 20 Jul 2003 14:24:57 -0000 1.5 --- OptionsClass.py 3 Aug 2003 22:22:38 -0000 1.6 *************** *** 580,588 **** return self._options[sect, opt].unconvert() ! def get(self, sect, opt): '''Get an option.''' if self.conversion_table.has_key((sect, opt)): sect, opt = self.conversion_table[sect, opt] ! return self._options[sect, opt].get() def __getitem__(self, key): --- 580,593 ---- return self._options[sect, opt].unconvert() ! def get_option(self, sect, opt): '''Get an option.''' if self.conversion_table.has_key((sect, opt)): sect, opt = self.conversion_table[sect, opt] ! return self._options[sect, opt] ! def get(self, sect, opt): ! '''Get an option value.''' ! if self.conversion_table.has_key((sect, opt)): ! sect, opt = self.conversion_table[sect, opt] ! return self.get_option(sect, opt).get() def __getitem__(self, key): From mhammond at users.sourceforge.net Sun Aug 3 17:38:27 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 19:38:31 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 config.py,1.19,1.20 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv7833 Modified Files: config.py Log Message: Few more docstrings for our config options Index: config.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/config.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** config.py 3 Aug 2003 14:15:48 -0000 1.19 --- config.py 3 Aug 2003 23:38:25 -0000 1.20 *************** *** 198,205 **** FOLDER_ID, DO_NOT_RESTORE), ("spam_threshold", "The score necessary to be considered 'certain' spam", 90.0, ! """""", REAL, RESTORE), ("spam_action", "The action to take for new spam", "Untouched", ! """""", FILTER_ACTION, RESTORE), ("spam_mark_as_read", "Should filtered spam also be marked as 'read'", False, --- 198,206 ---- FOLDER_ID, DO_NOT_RESTORE), ("spam_threshold", "The score necessary to be considered 'certain' spam", 90.0, ! """Any message with a Spam score greater than or equal to this value ! will be considered spam, and processed accordingly.""", REAL, RESTORE), ("spam_action", "The action to take for new spam", "Untouched", ! """The action that should be taken as Spam messages arrive.""", FILTER_ACTION, RESTORE), ("spam_mark_as_read", "Should filtered spam also be marked as 'read'", False, *************** *** 215,222 **** FOLDER_ID, DO_NOT_RESTORE), ("unsure_threshold", "The score necessary to be considered 'unsure'", 15.0, ! """""", REAL, RESTORE), ("unsure_action", "The action to take for new uncertain messages", "Untouched", ! """""", FILTER_ACTION, RESTORE), ("unsure_mark_as_read", "Should filtered uncertain message also be marked as 'read'", False, --- 216,225 ---- FOLDER_ID, DO_NOT_RESTORE), ("unsure_threshold", "The score necessary to be considered 'unsure'", 15.0, ! """Any message with a Spam score greater than or equal to this value ! (but less than the spam threshold) will be considered spam, and ! processed accordingly.""", REAL, RESTORE), ("unsure_action", "The action to take for new uncertain messages", "Untouched", ! """The action that should be taken as unsure messages arrive.""", FILTER_ACTION, RESTORE), ("unsure_mark_as_read", "Should filtered uncertain message also be marked as 'read'", False, *************** *** 236,243 **** BOOLEAN, DO_NOT_RESTORE), ("only_unread", "Only filter unread messages?", False, ! """When scoring messages, should only messages that are unread be considered?""", BOOLEAN, RESTORE), ("only_unseen", "Only filter previously unseen ?", False, ! """""", BOOLEAN, RESTORE), ("action_all", "Perform all filter actions?", True, --- 239,248 ---- BOOLEAN, DO_NOT_RESTORE), ("only_unread", "Only filter unread messages?", False, ! """When scoring messages, should only messages that are unread be ! considered?""", BOOLEAN, RESTORE), ("only_unseen", "Only filter previously unseen ?", False, ! """When scoring messages, should only messages that have never ! previously Spam scored be considered?""", BOOLEAN, RESTORE), ("action_all", "Perform all filter actions?", True, From mhammond at users.sourceforge.net Sun Aug 3 18:52:48 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 20:52:52 2003 Subject: [Spambayes-checkins] website faq.txt,1.22,1.23 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv19293 Modified Files: faq.txt Log Message: Add a new FAQ I get - "will show clues tell the spammer"? Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** faq.txt 30 Jul 2003 23:21:15 -0000 1.22 --- faq.txt 4 Aug 2003 00:52:46 -0000 1.23 *************** *** 452,455 **** --- 452,476 ---- require you to perform a full re-train. + Will "Show Spam Clues" notify a spammer that I opened their message? + -------------------------------------------------------------------- + We think not (but we don't have the source code to Outlook to check + for sure). In general, there are 2 ways spammers can determine this; + the first is via an automatic 'Read Receipt' (but this is unusual, as + the "from" address is generally forged so the receipt goes nowhere + useful). The second common trick is by sending HTML spam that + references unique URLs (generally images) on the spammer's server. + When this HTML message is rendered, these fetching of these URLs + identifies to the spammer the associated email address. + + As far as we are aware, SpamBayes does not generate a "read receipt" + for "Show Spam Clues", even though the message is marked as read (and + we don't know how to prevent it being marked as read). However + that if you are concerned about this, you are encouraged to configure + Outlook's generation of receipts manually. + + Further, as "Show Spam Clues" does not attempt to render the HTML nor + otherwise contact any of the URLs in the message, this will not + register a hit on the spammer's server. + Using Spambayes =============== From mhammond at users.sourceforge.net Sun Aug 3 18:55:14 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 20:55:19 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/installer spambayes_addin.spec, 1.6, 1.7 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/installer In directory sc8-pr-cvs1:/tmp/cvs-serv19634 Modified Files: spambayes_addin.spec Log Message: Install LICENSE.TXT, as at least one person was looking for it. Index: spambayes_addin.spec =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/installer/spambayes_addin.spec,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** spambayes_addin.spec 25 Jul 2003 15:58:34 -0000 1.6 --- spambayes_addin.spec 4 Aug 2003 00:55:11 -0000 1.7 *************** *** 19,22 **** --- 19,23 ---- # docs extras.append( ("about.html", join(PROJECT_ROOT, "about.html"), 'DATA') ) + extras.append( ("LICENSE.TXT", join(PROJECT_ROOT, "..", "LICENSE.TXT"), 'DATA') ) for fname in glob.glob(PROJECT_ROOT + "/docs/*"): if os.path.isfile(fname): From mhammond at users.sourceforge.net Sun Aug 3 18:56:09 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 20:56:13 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.85,1.86 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv19816 Modified Files: addin.py Log Message: Clarify that no *filterable* mail items are selected. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** addin.py 31 Jul 2003 10:08:20 -0000 1.85 --- addin.py 4 Aug 2003 00:56:07 -0000 1.86 *************** *** 881,885 **** if len(ret) == 0: ! self.manager.ReportError("No mail items are selected", "No selection") return None if allow_multi: --- 881,885 ---- if len(ret) == 0: ! self.manager.ReportError("No filterable mail items are selected", "No selection") return None if allow_multi: From mhammond at users.sourceforge.net Sun Aug 3 19:01:45 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 21:01:48 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources - New directory Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv20903/resources Log Message: Directory /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources added to the repository --> Using per-directory sticky tag `outlook-dialog-branch' From mhammond at users.sourceforge.net Sun Aug 3 19:13:58 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 21:14:02 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources .cvsignore, NONE, 1.1.2.1 dialogs.h, NONE, 1.1.2.1 dialogs.rc, NONE, 1.1.2.1 __init__.py, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv22636 Added Files: Tag: outlook-dialog-branch .cvsignore dialogs.h dialogs.rc __init__.py Log Message: Resources for our dialogs. --- NEW FILE: .cvsignore --- dialogs.aps --- NEW FILE: dialogs.h --- //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by dialogs.rc // #define IDD_MANAGER 101 #define IDD_TRAINING 102 #define IDD_FILTER 103 #define IDD_FILTER_NOW 104 #define IDC_PROGRESS 1000 #define IDC_PROGRESS_TEXT 1001 #define IDC_STATIC_HAM 1002 #define IDC_STATIC_SPAM 1003 #define IDC_BROWSE_HAM 1004 #define IDC_BROWSE_SPAM 1005 #define IDC_START 1006 #define IDC_BUT_REBUILD 1007 #define IDC_BUT_RESCORE 1008 #define IDC_VERSION 1009 #define IDC_BUT_TRAIN_FROM_SPAM_FOLDER 1010 #define IDC_BUT_TRAIN_TO_SPAM_FOLDER 1011 #define IDC_BUT_TRAIN_NOW 1012 #define IDC_BUT_FILTER_ENABLE 1013 #define IDC_FILTER_STATUS 1014 #define IDC_BUT_FILTER_NOW 1015 #define IDC_BUT_FILTER_DEFINE 1016 #define IDC_BUT_ABOUT 1017 #define IDC_BUT_ACT_SCORE 1018 #define IDC_BUT_ACT_ALL 1019 #define IDC_BUT_UNREAD 1020 #define IDC_BUT_UNSEEN 1021 #define IDC_BUT_FILTERNOW 1022 #define IDC_SLIDER_CERTAIN 1023 #define IDC_EDIT_CERTAIN 1024 #define IDC_ACTION_CERTAIN 1025 #define IDC_TOFOLDER_CERTAIN 1026 #define IDC_FOLDER_CERTAIN 1027 #define IDC_BROWSE_CERTAIN 1028 #define IDC_SLIDER_UNSURE 1029 #define IDC_EDIT_UNSURE 1030 #define IDC_ACTION_UNSURE 1031 #define IDC_TOFOLDER_UNSURE 1032 #define IDC_FOLDER_UNSURE 1033 #define IDC_BROWSE_UNSURE 1034 #define IDC_TRAINING_STATUS 1035 #define IDC_FOLDER_NAMES 1036 #define IDC_BROWSE 1037 #define IDC_FOLDER_WATCH 1038 #define IDC_BROWSE_WATCH 1039 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1039 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif --- NEW FILE: dialogs.rc --- //Microsoft Developer Studio generated resource script. // #include "dialogs.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (Australia) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_MANAGER DIALOGEX 0, 0, 242, 201 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "SpamBayes" FONT 8, "MS Sans Serif" BEGIN CONTROL "SpamBayes version xxx",IDC_VERSION,"Static", SS_LEFTNOWORDWRAP | WS_GROUP,8,4,230,11 GROUPBOX "Training",IDC_STATIC,8,17,227,103 LTEXT "Training is the process of giving examples of both good and bad email to the system so it can classify future email", IDC_STATIC,17,27,215,17 LTEXT "Automatically train that a message is good when:", IDC_STATIC,15,50,208,10 CONTROL "It is moved from a spam folder back to the Inbox", IDC_BUT_TRAIN_FROM_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,60,204,9 LTEXT "Automatically train that a message is spam when:", IDC_STATIC,15,74,208,10 CONTROL "It is moved to the certain-spam folder", IDC_BUT_TRAIN_TO_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,85,204,9 CONTROL "123 spam messages; 456 good messages", IDC_TRAINING_STATUS,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,15,98,146,14 PUSHBUTTON "Train Now...",IDC_BUT_TRAIN_NOW,167,98,63,14 GROUPBOX "Filtering",IDC_STATIC,7,122,228,57 LTEXT "Filtering defines how spam is handled as it arrives", IDC_STATIC,15,131,202,8 CONTROL "Enable &Filtering",IDC_BUT_FILTER_ENABLE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,20,143,120,11 LTEXT "Certain spam is moved to Folder1\nPossible spam is moved too", IDC_FILTER_STATUS,15,157,146,18,SS_SUNKEN PUSHBUTTON "Filter Now...",IDC_BUT_FILTER_NOW,167,141,63,14 PUSHBUTTON "Define Filters...",IDC_BUT_FILTER_DEFINE,167,160,63,14 PUSHBUTTON "About...",IDC_BUT_ABOUT,99,184,62,14 DEFPUSHBUTTON "Close",IDOK,167,184,62,14 END IDD_TRAINING DIALOGEX 0, 0, 241, 140 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "Training" FONT 8, "MS Sans Serif" BEGIN LTEXT "Folders with known good messages.",IDC_STATIC,7,6,131, 11 CONTROL "",IDC_STATIC_HAM,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN,7,17,167,12 PUSHBUTTON "&Browse...",IDC_BROWSE_HAM,184,17,50,14 LTEXT "Folders with spam or other junk messages",IDC_STATIC,7, 36,171,9 CONTROL "Static",IDC_STATIC_SPAM,"Static",SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,7,47,167,12 PUSHBUTTON "Brow&se...",IDC_BROWSE_SPAM,184,47,50,14 CONTROL "&Rebuild entire database",IDC_BUT_REBUILD,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,67,174,10 CONTROL "Score &messages after training",IDC_BUT_RESCORE,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,7,77,174,10 PUSHBUTTON "&Train Now",IDC_START,7,119,50,14 CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7, 92,166,11 LTEXT "",IDC_PROGRESS_TEXT,7,108,227,10 DEFPUSHBUTTON "Close",IDOK,184,119,50,14 END IDD_FILTER_NOW DIALOGEX 0, 0, 244, 182 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Now" FONT 8, "MS Sans Serif" BEGIN LTEXT "Filter the following folders",IDC_STATIC,8,9,168,11 CONTROL "Folder names...\nLine 2",IDC_FOLDER_NAMES,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN,7,20,172, 12 PUSHBUTTON "Browse...",IDC_BROWSE,187,19,50,14 GROUPBOX "Filter action",IDC_STATIC,7,38,230,40,WS_GROUP CONTROL "Perform all filter actions",IDC_BUT_ACT_ALL,"Button", BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,15,49,126,10 CONTROL "Score messages, but don't perform filter action", IDC_BUT_ACT_SCORE,"Button",BS_AUTORADIOBUTTON,15,62,203, 10 GROUPBOX "Restrict the filter to",IDC_STATIC,7,84,230,35,WS_GROUP CONTROL "Unread mail",IDC_BUT_UNREAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,94,149,9 CONTROL "Mail never previously spam filtered",IDC_BUT_UNSEEN, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,106,149,9 CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER,7, 129,230,11 LTEXT "Static",IDC_PROGRESS_TEXT,7,144,227,10 PUSHBUTTON "Filter Now",IDC_START,7,161,50,14 DEFPUSHBUTTON "Close",IDOK,187,161,50,14 END IDD_FILTER DIALOGEX 0, 0, 249, 239 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Rules" FONT 8, "MS Sans Serif" BEGIN LTEXT "Filter the following folders as messages arrive", IDC_STATIC,8,9,168,11 CONTROL "Folder names...\nLine 2",IDC_FOLDER_WATCH,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,7,20,177,12 PUSHBUTTON "Browse...",IDC_BROWSE_WATCH,192,19,50,14 GROUPBOX "Certain Spam",IDC_STATIC,7,43,235,65 LTEXT "To be considered certain spam, a message must score at least", IDC_STATIC,13,52,212,10 CONTROL "Slider1",IDC_SLIDER_CERTAIN,"msctls_trackbar32", TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,13,62,165,12 EDITTEXT IDC_EDIT_CERTAIN,184,63,51,14,ES_AUTOHSCROLL LTEXT "and these mesages should be:",IDC_STATIC,13,76,107,10 COMBOBOX IDC_ACTION_CERTAIN,13,88,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "to folder",IDC_STATIC,75,90,31,10 CONTROL "Folder names...",IDC_FOLDER_CERTAIN,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,120,88,59,14 PUSHBUTTON "Browse",IDC_BROWSE_CERTAIN,184,88,50,14 GROUPBOX "Possible Spam",IDC_STATIC,7,114,235,68 LTEXT "To be considered uncertain, a message must score at least", IDC_STATIC,13,124,212,10 CONTROL "Slider1",IDC_SLIDER_UNSURE,"msctls_trackbar32", TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,13,137,165,12 EDITTEXT IDC_EDIT_UNSURE,184,137,54,14,ES_AUTOHSCROLL LTEXT "and these mesages should be:",IDC_STATIC,13,150,107,10 COMBOBOX IDC_ACTION_UNSURE,13,161,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "to folder",IDC_STATIC,75,164,31,10 CONTROL "(folder name)",IDC_FOLDER_UNSURE,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,120,161,59,14 PUSHBUTTON "&Browse",IDC_BROWSE_UNSURE,184,161,50,14 GROUPBOX "Good messages",IDC_STATIC,7,185,235,25 LTEXT "All other messages are considered good, and are not filtered", IDC_STATIC,14,196,212,10 PUSHBUTTON "Filter Now...",IDC_BUT_FILTERNOW,7,218,50,14 PUSHBUTTON "Close",IDOK,192,218,50,14 END #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE DISCARDABLE BEGIN "dialogs.h\0" END 2 TEXTINCLUDE DISCARDABLE BEGIN "// spambayes dialog definitions \r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED #endif // English (Australia) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED --- NEW FILE: __init__.py --- # Empty file to designate this directory as a module. From mhammond at users.sourceforge.net Sun Aug 3 19:14:16 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 21:14:19 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rcparser.py, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv22717 Added Files: Tag: outlook-dialog-branch rcparser.py Log Message: Resource script parser, by Adam Walker. --- NEW FILE: rcparser.py --- # Windows dialog .RC file parser, by Adam Walker. # This module is part of the spambayes project, which is Copyright 2002 # The Python Software Foundation and is covered by the Python Software # Foundation license. __author__="Adam Walker" import sys, os, shlex import win32con import commctrl _controlMap = {"DEFPUSHBUTTON":0x80, "PUSHBUTTON":0x80, "Button":0x80, "Static":0x82, "CTEXT":0x82, "RTEXT":0x82, "GROUPBOX":0x82, "LTEXT":0x82, "LISTBOX":0x83, "SCROLLBAR":0x84, "COMBOBOX":0x85, "EDITTEXT":0x81, } _addDefaults = {"EDITTEXT":win32con.WS_BORDER, "GROUPBOX":win32con.BS_GROUPBOX, "LTEXT":win32con.SS_LEFT, "DEFPUSHBUTTON":win32con.BS_DEFPUSHBUTTON, "CTEXT":win32con.SS_CENTER, "RTEXT":win32con.SS_RIGHT} defaultControlStyle = win32con.WS_CHILD | win32con.WS_VISIBLE class DialogDef: name = "" id = 0 style = 0 styleEx = None caption = "" font = "MS Sans Serif" fontSize = 8 x = 0 y = 0 w = 0 h = 0 template = None def __init__(self, n, i): self.name = n self.id = i self.styles = [] self.stylesEx = [] self.controls = [] #print "dialog def for ",self.name, self.id def createDialogTemplate(self): t = None self.template = [[self.caption, (self.x,self.y,self.w,self.h), self.style, self.styleEx, (self.fontSize, self.font)]] # Add the controls for control in self.controls: self.template.append(control.createDialogTemplate()) return self.template class ControlDef: id = "" controlType = "" subType = "" idNum = 0 style = defaultControlStyle label = "" x = 0 y = 0 w = 0 h = 0 def __init__(self): self.styles = [] def toString(self): s = "" return s def createDialogTemplate(self): ct = self.controlType if "CONTROL"==ct: ct = self.subType if ct in _addDefaults: self.style |= _addDefaults[ct] if ct in _controlMap: ct = _controlMap[ct] t = [ct, self.label, self.idNum, (self.x, self.y, self.w, self.h), self.style] #print t return t class RCParser: ids = {"IDOK":1, "IDCANCEL":2, "IDC_STATIC": -1} names = {1:"IDOK", 2:"IDCANCEL", -1:"IDC_STATIC"} next_id = 1001 dialogs = {} debugEnabled = False; token = "" def debug(self, *args): if self.debugEnabled: print args def getToken(self): self.token = self.lex.get_token() self.debug("getToken returns:", self.token) if self.token=="": self.token = None return self.token def loadDialogs(self, rcFileName): """ RCParser.loadDialogs(rcFileName) -> None Load the dialog information into the parser. Dialog Definations can then be accessed using the "dialogs" dictionary member (name->DialogDef). The "ids" member contains the dictionary of id->name. The "names" member contains the dictionary of name->id """ f = open(rcFileName) self.open(f) while self.token!=None and self.token[0:4]!="IDD_": self.getToken() while self.token!=None and self.token[0:4]=="IDD_": self.parse() self.getToken() #close(f) def open(self, file): self.lex = shlex.shlex(file) self.lex.commenters = "//#" def parse(self): if self.token == None: more == None elif "LANGUAGE" == self.token: more = self.lang() else: possibleDlgName = self.token self.getToken() if "DIALOG" == self.token or "DIALOGEX" == self.token: self.dialog(possibleDlgName) def addId(self, id_name): if id_name in self.ids: id = self.ids[id_name] else: id = self.next_id self.next_id += 1 self.ids[id_name] = id self.names[id] = id_name return id def lang(self): while self.token[0:4]=="LANG" or self.token[0:7]=="SUBLANG" or self.token==',': self.getToken(); def dialog(self, name): dlg = DialogDef(name,self.addId(name)) assert len(dlg.controls)==0 self.dialogs[name] = dlg extras = [] self.getToken() while not self.token.isdigit(): self.debug("extra", self.token) extras.append(self.token) self.getToken() dlg.x = int(self.token) self.getToken() # should be , self.getToken() # number dlg.y = int(self.token) self.getToken() # should be , self.getToken() # number dlg.w = int(self.token) self.getToken() # should be , self.getToken() # number dlg.h = int(self.token) self.getToken() while not (self.token==None or self.token=="" or self.token=="END"): if self.token=="STYLE": self.dialogStyle(dlg) elif self.token=="EXSTYLE": self.dialogExStyle(dlg) elif self.token=="CAPTION": self.dialogCaption(dlg) elif self.token=="FONT": self.dialogFont(dlg) elif self.token=="BEGIN": self.controls(dlg) else: break def dialogStyle(self, dlg): dlg.style, dlg.styles = self.styles( [], win32con.WS_VISIBLE | win32con.DS_SETFONT) def dialogExStyle(self, dlg): self.getToken() dlg.styleEx, dlg.stylesEx = self.styles( [], 0) def styles(self, defaults, defaultStyle): list = defaults style = defaultStyle if "STYLE"==self.token: self.getToken() i = 0 Not = False while ((i%2==1 and ("|"==self.token or "NOT"==self.token)) or (i%2==0)) and not self.token==None: Not = False; if "NOT"==self.token: Not = True self.getToken() i += 1 if self.token!="|": if self.token in win32con.__dict__: value = getattr(win32con,self.token) else: value = getattr(commctrl,self.token) if Not: list.append("NOT "+self.token) self.debug("styles add Not",self.token, value) style &= ~value else: list.append(self.token) self.debug("styles add", self.token, value) style |= value self.getToken() self.debug("style is ",style) return style, list def dialogCaption(self, dlg): if "CAPTION"==self.token: self.getToken() self.token = self.token[1:-1] self.debug("Caption is:",self.token) dlg.caption = self.token self.getToken() def dialogFont(self, dlg): if "FONT"==self.token: self.getToken() dlg.fontSize = int(self.token) self.getToken() # , self.getToken() # Font name dlg.font = self.token[1:-1] # it's quoted self.getToken() while "BEGIN"!=self.token: self.getToken() def controls(self, dlg): if self.token=="BEGIN": self.getToken() while self.token!="END": control = ControlDef() control.controlType = self.token; #print self.token self.getToken() if self.token[0:1]=='"': control.label = self.token[1:-1] self.getToken() # , self.getToken() control.id = self.token control.idNum = self.addId(control.id) self.getToken() # , if control.controlType == "CONTROL": self.getToken() control.subType = self.token[1:-1] # Styles self.getToken() #, self.getToken() control.style, control.styles = self.styles([], defaultControlStyle) #self.getToken() #, # Rect control.x = int(self.getToken()) self.getToken() # , control.y = int(self.getToken()) self.getToken() # , control.w = int(self.getToken()) self.getToken() # , self.getToken() control.h = int(self.token) self.getToken() if self.token==",": self.getToken() control.style, control.styles = self.styles([], defaultControlStyle) #print control.toString() dlg.controls.append(control) def ParseDialogs(rc_file): rcp = RCParser() rcp.loadDialogs(rc_file) return rcp def test(): from pywin.mfc import dialog rcp = ParseDialogs("resources/dialogs.rc") for idName in rcp.dialogs: dlg = dialog.Dialog(rcp.dialogs[idName].createDialogTemplate()) dlg.DoModal() return rcp if __name__=='__main__': test() From mhammond at users.sourceforge.net Sun Aug 3 19:15:49 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 21:15:53 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dlgcore.py, NONE, 1.1.2.1 dlgutils.py, NONE, 1.1.2.1 processors.py, NONE, 1.1.2.1 opt_processors.py, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv22917 Added Files: Tag: outlook-dialog-branch dlgcore.py dlgutils.py processors.py opt_processors.py Log Message: New data driven dialogs loaded from Windows .rc scripts. --- NEW FILE: dlgcore.py --- # A core, data-driven dialog. # Driven completely by "Control Processor" objects. # This module is part of the spambayes project, which is Copyright 2002 # The Python Software Foundation and is covered by the Python Software # Foundation license. import win32gui, win32api, win32con import commctrl import struct, array from dlgutils import * # Isolate the nasty stuff for tooltips somewhere. class TooltipManager: def __init__(self, dialog): self.dialog = dialog self.hwnd_tooltip = None self.tooltip_tools = {} def HideTooltip(self): if self.hwnd_tooltip is not None: win32gui.SendMessage(self.hwnd_tooltip, commctrl.TTM_TRACKACTIVATE, 0, 0) def ShowTooltipForControl(self, control_id, text): # Note sure this tooltip stuff is quite right! # Hide an existing one, so the new one gets created. # (new one empty is no big deal, but hiding the old one is, so # we get re-queried for the text. hwnd_dialog = self.dialog.hwnd self.HideTooltip() if self.hwnd_tooltip is None: TTS_BALLOON = 0x40 self.hwnd_tooltip = win32gui.CreateWindowEx(0, "tooltips_class32", None, win32con.WS_POPUP | TTS_BALLOON, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, hwnd_dialog, 0, 0, None) # 80 chars max for our tooltip # hrm - how to measure this in pixels! win32gui.SendMessage(self.hwnd_tooltip, commctrl.TTM_SETMAXTIPWIDTH, 0, 300) format = "iiiiiiiiiii" tt_size = struct.calcsize(format) buffer = array.array("c", text + "\0") text_address, size = buffer.buffer_info() uID = control_id flags = commctrl.TTF_TRACK | commctrl.TTF_ABSOLUTE data = struct.pack(format, tt_size, flags, hwnd_dialog, uID, 0,0,0,0, 0, text_address, 0) # Add a tool for this control only if we haven't already if control_id not in self.tooltip_tools: win32gui.SendMessage(self.hwnd_tooltip, commctrl.TTM_ADDTOOL, 0, data) self.tooltip_tools[control_id] = 1 control = win32gui.GetDlgItem(hwnd_dialog, control_id) child_rect = win32gui.GetWindowRect(control) xOff = yOff = 15 # just below and right of the control win32gui.SendMessage(self.hwnd_tooltip, commctrl.TTM_TRACKPOSITION, 0, MAKELONG(child_rect[0]+xOff, child_rect[1]+yOff)) win32gui.SendMessage(self.hwnd_tooltip, commctrl.TTM_TRACKACTIVATE, 1,data) class Dialog: def __init__(self, parent, manager, idd, option_handlers): parser = manager.dialog_parser self.parent = parent self.manager = manager self.tt = TooltipManager(self) self.dialog_def = parser.dialogs[idd] self.template = self.dialog_def.createDialogTemplate() win32gui.InitCommonControls() self.hinst = win32api.GetModuleHandle(None) self.options = manager.options self.command_processors = {} self.processor_message_map = {} # WM_MESSAGE : [processors_who_want_it] self.all_processors = [] for data in option_handlers: klass = data[0] id_names = data[1] rest = data[2:] ids = id_names.split() int_ids = [ parser.ids[id] for id in ids] instance = klass(self,int_ids, *rest) self.all_processors.append(instance) for int_id in int_ids: self.command_processors[int_id] = instance for message in instance.GetMessages(): existing = self.processor_message_map.setdefault(message, []) existing.append(instance) def CreateWindow(self): self._DoCreate(win32gui.CreateDialogIndirect) def DoModal(self): return self._DoCreate(win32gui.DialogBoxIndirect) def OnCommandProcessorMessage(self, hwnd, msg, wparam, lparam): for p in self.processor_message_map[msg]: p.OnMessage(msg, wparam, lparam) def GetMessageMap(self): ret = { #win32con.WM_SIZE: self.OnSize, win32con.WM_COMMAND: self.OnCommand, win32con.WM_NOTIFY: self.OnNotify, win32con.WM_INITDIALOG: self.OnInitDialog, win32con.WM_CLOSE: self.OnClose, win32con.WM_HELP: self.OnHelp, win32con.WM_DESTROY: self.OnDestroy, win32con.WM_LBUTTONDOWN: self.OnLButtonDown, win32con.WM_ACTIVATE: self.OnActivate, } for key in self.processor_message_map.keys(): if key in ret: print "*** WARNING: Overwriting message!!!" ret[key] = self.OnCommandProcessorMessage return ret def _DoCreate(self, fn): message_map = self.GetMessageMap() return win32gui.DialogBoxIndirect(self.hinst, self.template, self.parent, message_map) def OnInitDialog(self, hwnd, msg, wparam, lparam): self.hwnd = hwnd self.LoadAllControls() # centre the dialog desktop = win32gui.GetDesktopWindow() l,t,r,b = win32gui.GetWindowRect(self.hwnd) dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop) centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)/2, (dt_b-dt_t)/2) ) win32gui.MoveWindow(hwnd, centre_x-(r/2), centre_y-(b/2), r-l, b-t, 0) l,t,r,b = win32gui.GetClientRect(self.hwnd) self._DoSize(r-l,b-t, 1) def OnDestroy(self, hwnd, msg, wparam, lparam): print "OnDestroy" self.command_processors = None self.all_processors = None self.processor_message_map = None def _DoSize(self, cx, cy, repaint = 1): print "resize" def OnLButtonDown(self, hwnd, msg, wparam, lparam): self.tt.HideTooltip() def OnActivate(self, hwnd, msg, wparam, lparam): self.tt.HideTooltip() def OnHelp(self, hwnd, msg, wparam, lparam): format = "iiiiiii" buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) cbSize, iContextType, iCtrlId, hItemHandle, dwContextID, x, y = \ struct.unpack(format, buf) #print "OnHelp", cbSize, iContextType, iCtrlId, hItemHandle, dwContextID, x, y cp = self.command_processors.get(iCtrlId) tt_text = None if cp is not None: tt_text = cp.GetPopupHelpText(iCtrlId) else: print "Can not get command processor for", iCtrlId if tt_text: self.tt.ShowTooltipForControl(iCtrlId, tt_text) else: self.tt.HideTooltip() return 1 def LoadAllControls(self): for p in self.all_processors: p.Init() def SaveAllControls(self): for p in self.all_processors: try: p.Done(True) except ValueError, why: mb_flags = win32con.MB_ICONEXCLAMATION | win32con.MB_OK win32gui.MessageBox(self.hwnd, str(why), self.dialog_def.caption, mb_flags) win32gui.SetFocus(p.GetControl()) return False return True def OnClose(self, hwnd, msg, wparam, lparam): print "OnClose" if not self.SaveAllControls(): return 1 win32gui.EndDialog(hwnd, 0) def OnSize(self, hwnd, msg, wparam, lparam): x = win32api.LOWORD(lparam) y = win32api.HIWORD(lparam) self._DoSize(x,y) return 1 def OnNotify(self, hwnd, msg, wparam, lparam): #print "OnNotify", hwnd, msg, wparam, lparam # Parse the NMHDR format = "iii" buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) hwndFrom, idFrom, code = struct.unpack(format, buf) code += 0x4f0000 # hrm - wtf - commctrl uses this, and it works with mfc. *sigh* # delegate rest to our commands. handler = self.command_processors.get(idFrom) if handler is None: print "Ignoring OnNotify for", idFrom return handler.OnNotify( (hwndFrom, idFrom, code), wparam, lparam) def OnCommand(self, hwnd, msg, wparam, lparam): self.tt.HideTooltip() id = win32api.LOWORD(wparam) handler = self.command_processors.get(id) if handler is None: print "Ignoring OnCommand for", id return handler.OnCommand(wparam, lparam) --- NEW FILE: dlgutils.py --- # Generic utilities for dialog functions. # This module is part of the spambayes project, which is Copyright 2002 # The Python Software Foundation and is covered by the Python Software # Foundation license. def MAKELONG(l,h): return ((h & 0xFFFF) << 16) | (l & 0xFFFF) def SetWaitCursor(wait): import win32gui if wait: hCursor = win32gui.LoadCursor(0, win32con.IDC_WAIT) else: hCursor = win32gui.LoadCursor(0, 0) win32gui.SetCursor(hCursor) --- NEW FILE: processors.py --- # Control Processors for our dialog. # This module is part of the spambayes project, which is Copyright 2002 # The Python Software Foundation and is covered by the Python Software # Foundation license. import win32gui, win32api, win32con import commctrl import struct, array from dlgutils import * # A generic set of "ControlProcessors". A control processor by itself only # does a few basic things. class ControlProcessor: def __init__(self, window, control_ids): self.control_id = control_ids[0] self.other_ids = control_ids[1:] self.window = window def Init(self): pass def Done(self, saving): pass def GetControl(self, control_id = None): control_id = control_id or self.control_id return win32gui.GetDlgItem(self.window.hwnd, control_id) def GetPopupHelpText(self, idFrom): return None def OnCommand(self, wparam, lparam): pass def OnNotify(self, nmhdr, wparam, lparam): pass def GetMessages(self): return [] def OnMessage(self, msg, wparam, lparam): raise RuntimeError, "I don't hook any messages, so I shouldn't be called" class ButtonProcessor(ControlProcessor): def OnCommand(self, wparam, lparam): code = win32api.HIWORD(wparam) id = win32api.LOWORD(wparam) if code == win32con.BN_CLICKED: self.OnClicked(id) class CloseButtonProcessor(ButtonProcessor): def OnClicked(self, id): print "clicked" win32gui.SendMessage(self.window.hwnd, win32con.WM_CLOSE, 0, 0) def GetPopupHelpText(self, ctrlid): return "Closes this dialog" class CommandButtonProcessor(ButtonProcessor): def __init__(self, window, control_ids, func, args): assert len(control_ids)==1 self.func = func self.args = args ControlProcessor.__init__(self, window, control_ids) def OnClicked(self, id): # Bit of a hack - always pass the manager as the first arg. args = (self.window.manager,) + self.args self.func(*args) def GetPopupHelpText(self, ctrlid): assert ctrlid == self.control_id return " ".join(self.func.__doc__.split()) class DialogCommand(ButtonProcessor): def __init__(self, window, control_ids, idd): self.idd = idd ButtonProcessor.__init__(self, window, control_ids) def OnClicked(self, id): parent = self.window.hwnd # Thos form and the other form may "share" options, or at least # depend on others. So we must save the current form back to the # options object, display the new dialog, then reload the current # form from the options object/ self.window.SaveAllControls() ShowDialog(parent, self.window.manager, self.idd) self.window.LoadAllControls() def GetPopupHelpText(self, id): dd = self.window.manager.dialog_parser.dialogs[self.idd] return "Displays the %s dialog" % dd.caption --- NEW FILE: opt_processors.py --- # Option Control Processors for our dialog. # These are extensions to basic Control Processors that are linked with # SpamBayes options. # This module is part of the spambayes project, which is Copyright 2002 # The Python Software Foundation and is covered by the Python Software # Foundation license. import win32gui, win32api, win32con import commctrl import struct, array from dlgutils import * import processors # A ControlProcessor that is linked up with options. These get a bit smarter. class OptionControlProcessor(processors.ControlProcessor): def __init__(self, window, control_ids, option): processors.ControlProcessor.__init__(self, window, control_ids) if option: sect_name, option_name = option.split(".") self.option = window.options.get_option(sect_name, option_name) else: self.option = None self.value = None def GetPopupHelpText(self, idFrom): return " ".join(self.option.doc().split()) # We override Init, and break it into 2 steps. # - Load option into self.value # - set the control from self.value. def Init(self): self.LoadOptionValue() self.UpdateControl_FromValue() # We override Done into 2 similar steps # - Update self.value from the current contents of the control. # - Write self.value back to the option. def Done(self, saving): if saving: self.UpdateValue_FromControl() self.StoreOptionValue() def LoadOptionValue(self): self.value = self.option.get() def StoreOptionValue(self): print "Setting", self.option.name, "to", self.value self.option.set(self.value) # Only sub-classes know how to update their controls from the value. def UpdateControl_FromValue(self): raise NotImplementedError def UpdateValue_FromControl(self): raise NotImplementedError # "Bool" buttons are simple - just toggle self.value on the click. # (Little more complex to handle "radio buttons" that are also boolean # where we must "uncheck" the other button. class BoolButtonProcessor(OptionControlProcessor): def OnCommand(self, wparam, lparam): code = win32api.HIWORD(wparam) if code == win32con.BN_CLICKED: self.UpdateValue_FromControl() def UpdateControl_FromValue(self): win32gui.SendMessage(self.GetControl(), win32con.BM_SETCHECK, self.value) for other in self.other_ids: win32gui.SendMessage(self.GetControl(other), win32con.BM_SETCHECK, not self.value) def UpdateValue_FromControl(self): check = win32gui.SendMessage(self.GetControl(), win32con.BM_GETCHECK) check = not not check # force bool! self.value = check # A "Combo" processor, that loads valid strings from the option. class ComboProcessor(OptionControlProcessor): def UpdateControl_FromValue(self): # First load the combo options. combo = self.GetControl() index = sel_index = 0 for s in self.option.valid_input(): win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, s) if self.value.startswith(s): sel_index = index index += 1 win32gui.SendMessage(combo, win32con.CB_SETCURSEL, sel_index, 0) def UpdateValue_FromControl(self): combo = self.GetControl() sel = win32gui.SendMessage(combo, win32con.CB_GETCURSEL) len = win32gui.SendMessage(combo, win32con.CB_GETLBTEXTLEN, sel) buffer = array.array("c", "\0" * (len + 1)) win32gui.SendMessage(combo, win32con.CB_GETLBTEXT, sel, buffer) # Trim the \0 from the end. self.value = buffer.tostring()[:-1] print "Combo gave me", self.value class EditNumberProcessor(OptionControlProcessor): def __init__(self, window, control_ids, option): self.slider_id = control_ids and control_ids[1] OptionControlProcessor.__init__(self, window, control_ids, option) def GetPopupHelpText(self, id): if id == self.slider_id: return "As you drag this slider, the value to the right will " \ "automatically adjust" return OptionControlProcessor.GetPopupHelpText(self, id) def GetMessages(self): return [win32con.WM_HSCROLL] def OnMessage(self, msg, wparam, lparam): slider = self.GetControl(self.slider_id) if slider == lparam: slider_pos = win32gui.SendMessage(slider, commctrl.TBM_GETPOS, 0, 0) slider_pos = float(slider_pos) str_val = str(slider_pos) edit = self.GetControl() win32gui.SendMessage(edit, win32con.WM_SETTEXT, 0, str_val) def OnCommand(self, wparam, lparam): code = win32api.HIWORD(wparam) if code==win32con.EN_CHANGE: try: self.UpdateValue_FromControl() self.UpdateSlider_FromEdit() except ValueError: # They are typing - value may be currently invalid pass def Init(self): OptionControlProcessor.Init(self) if self.slider_id: self.InitSlider() def InitSlider(self): slider = self.GetControl(self.slider_id) win32gui.SendMessage(slider, commctrl.TBM_SETRANGE, 0, MAKELONG(0, 100)) win32gui.SendMessage(slider, commctrl.TBM_SETLINESIZE, 0, 1) win32gui.SendMessage(slider, commctrl.TBM_SETPAGESIZE, 0, 5) win32gui.SendMessage(slider, commctrl.TBM_SETTICFREQ, 10, 0) def UpdateControl_FromValue(self): win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, str(self.value)) self.UpdateSlider_FromEdit() def UpdateSlider_FromEdit(self): slider = self.GetControl(self.slider_id) try: # Get as float so we dont fail should the .0 be there, but # then convert to int as the slider only works with ints val = int(float(self.value)) except ValueError: return win32gui.SendMessage(slider, commctrl.TBM_SETPOS, 1, val) def UpdateValue_FromControl(self): buf_size = 100 buf = win32gui.PyMakeBuffer(buf_size) nchars = win32gui.SendMessage(self.GetControl(), win32con.WM_GETTEXT, buf_size, buf) str_val = buf[:nchars] val = float(str_val) if val < 0 or val > 100: raise ValueError, "Value must be between 0 and 100" self.value = val # Folder IDs, and the "include_sub" option, if applicable. class FolderIDProcessor(OptionControlProcessor): def __init__(self, window, control_ids, option, option_include_sub = None): self.button_id = control_ids[1] if option_include_sub: incl_sub_sect_name, incl_sub_option_name = \ option_include_sub.split(".") self.option_include_sub = \ window.options.get_option(incl_sub_sect_name, incl_sub_option_name) else: self.option_include_sub = None OptionControlProcessor.__init__(self, window, control_ids, option) def LoadOptionValue(self): self.value = self.option.get() if self.option_include_sub: self.value_include_sub = self.option_include_sub.get() def StoreOptionValue(self): self.option.set(self.value) if self.option_include_sub: self.option_include_sub.set(self.value_include_sub) def OnCommand(self, wparam, lparam): mgr = self.window.manager id = win32api.LOWORD(wparam) if id == self.button_id: is_multi = self.option.multiple_values_allowed() if is_multi: ids = self.value else: ids = [self.value] from dialogs import FolderSelector if self.option_include_sub: cb_state = self.value_include_sub else: cb_state = None # don't show it. d = FolderSelector.FolderSelector(mgr, ids, single_select=not is_multi, checkbox_state=cb_state) if d.DoModal() == win32con.IDOK: ids, include_sub = d.GetSelectedIDs() if is_multi: self.value = ids else: self.value = ids[0] if self.option_include_sub: self.value_include_sub = include_sub self.UpdateControl_FromValue() def GetPopupHelpText(self, idFrom): if idFrom == self.button_id: return "Displays a list from which you can select folders." return OptionControlProcessor.GetPopupHelpText(self, idFrom) def UpdateControl_FromValue(self): # Set the static to folder names mgr = self.window.manager if self.option.multiple_values_allowed(): ids = self.value else: ids = [self.value] names = [] for eid in ids: folder = mgr.message_store.GetFolder(eid) if folder is None: name = "" else: name = folder.name names.append(name) win32gui.SetWindowText(self.GetControl(), "; ".join(names)) def UpdateValue_FromControl(self): # We only update our self.value via the dialog, so # no need to copy control value to self.value. pass From mhammond at users.sourceforge.net Sun Aug 3 19:16:30 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 21:16:34 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs test_dialogs.py, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv23083 Added Files: Tag: outlook-dialog-branch test_dialogs.py Log Message: Testing the new dialogs. --- NEW FILE: test_dialogs.py --- # Hack for testing - setup sys.path if __name__=='__main__': try: import spambayes.Options except ImportError: import sys, os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", ".."))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))) from processors import * from opt_processors import * # "dialog specific" processors: class VersionStringProcessor(ControlProcessor): def Init(self): from spambayes.Version import get_version_string import sys version_key = "Full Description" if hasattr(sys, "frozen"): version_key += " Binary" version_string = get_version_string("Outlook", version_key) win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, version_string) def GetPopupHelpText(self, cid): return "The version of SpamBayes running" def ShowAbout(mgr): """Displays the main SpamBayes documentation in your Web browser""" import sys, os if hasattr(sys, "frozen"): # Same directory as to the executable. fname = os.path.join(os.path.dirname(sys.argv[0]), "about.html") else: # In the parent (ie, main Outlook2000) dir fname = os.path.join(os.path.dirname(__file__), os.pardir, "about.html") fname = os.path.abspath(fname) if os.path.isfile(fname): SetWaitCursor(1) os.startfile(fname) SetWaitCursor(0) else: print "Cant find about - fix messagebox" self.MessageBox("Can't find about.html") dialog_map = { "IDD_MANAGER" : ( (CloseButtonProcessor, "IDOK"), (VersionStringProcessor, "IDC_VERSION"), (BoolButtonProcessor, "IDC_BUT_TRAIN_FROM_SPAM_FOLDER", "Training.train_recovered_spam"), (BoolButtonProcessor, "IDC_BUT_TRAIN_TO_SPAM_FOLDER", "Training.train_manual_spam"), (DialogCommand, "IDC_BUT_FILTER_NOW", "IDD_FILTER_NOW"), (DialogCommand, "IDC_BUT_FILTER_DEFINE", "IDD_FILTER"), (DialogCommand, "IDC_BUT_TRAIN_NOW", "IDD_TRAINING"), (CommandButtonProcessor, "IDC_BUT_ABOUT", ShowAbout, ()), ), "IDD_FILTER_NOW" : ( (CloseButtonProcessor, "IDOK"), (BoolButtonProcessor, "IDC_BUT_UNREAD", "Filter_Now.only_unread"), (BoolButtonProcessor, "IDC_BUT_UNSEEN", "Filter_Now.only_unseen"), (BoolButtonProcessor, "IDC_BUT_ACT_ALL IDC_BUT_ACT_SCORE", "Filter_Now.action_all"), (FolderIDProcessor, "IDC_FOLDER_NAMES IDC_BROWSE", "Filter_Now.folder_ids", "Filter_Now.include_sub"), ), "IDD_FILTER" : ( (CloseButtonProcessor, "IDOK"), (FolderIDProcessor, "IDC_FOLDER_WATCH IDC_BROWSE_WATCH", "Filter.watch_folder_ids", "Filter.watch_include_sub"), (ComboProcessor, "IDC_ACTION_CERTAIN", "Filter.spam_action"), (FolderIDProcessor, "IDC_FOLDER_CERTAIN IDC_BROWSE_CERTAIN", "Filter.spam_folder_id"), (EditNumberProcessor, "IDC_EDIT_CERTAIN IDC_SLIDER_CERTAIN", "Filter.spam_threshold"), (FolderIDProcessor, "IDC_FOLDER_UNSURE IDC_BROWSE_UNSURE", "Filter.unsure_folder_id"), (EditNumberProcessor, "IDC_EDIT_UNSURE IDC_SLIDER_UNSURE", "Filter.unsure_threshold"), (ComboProcessor, "IDC_ACTION_UNSURE", "Filter.unsure_action"), (DialogCommand, "IDC_BUT_FILTER_NOW", "IDD_FILTER_NOW"), ), "IDD_TRAINING" : ( (CloseButtonProcessor, "IDOK"), (FolderIDProcessor, "IDC_STATIC_HAM IDC_BROWSE_HAM", "Training.ham_folder_ids", "Training.ham_include_sub"), (FolderIDProcessor, "IDC_STATIC_SPAM IDC_BROWSE_SPAM", "Training.spam_folder_ids", "Training.spam_include_sub"), (BoolButtonProcessor, "IDC_BUT_RESCORE", "Training.rescore"), (BoolButtonProcessor, "IDC_BUT_REBUILD", "Training.rebuild"), ) } def LoadDialogs(rc_file): from dialogs.resources import rcparser if not os.path.isabs(rc_file): rc_file = os.path.join( os.path.dirname( rcparser.__file__ ), rc_file) return rcparser.ParseDialogs(rc_file) def ShowDialog(parent, manager, idd): """Displays another dialog""" commands = dialog_map[idd] import dlgcore dlg = dlgcore.Dialog(parent, manager, idd, commands) dlg.DoModal() if __name__=='__main__': import manager mgr = manager.GetManager() mgr.dialog_parser = LoadDialogs("dialogs.rc") ShowDialog(0, mgr, "IDD_MANAGER") From mhammond at users.sourceforge.net Sun Aug 3 19:42:29 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 21:42:33 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs test_dialogs.py, 1.1.2.1, 1.1.2.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv27209 Modified Files: Tag: outlook-dialog-branch test_dialogs.py Log Message: Get sub-dialogs working again after my pre-checkin reorg frenzy Index: test_dialogs.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/test_dialogs.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** test_dialogs.py 4 Aug 2003 01:16:28 -0000 1.1.2.1 --- test_dialogs.py 4 Aug 2003 01:42:27 -0000 1.1.2.2 *************** *** 47,50 **** --- 47,68 ---- self.MessageBox("Can't find about.html") + class DialogCommand(ButtonProcessor): + def __init__(self, window, control_ids, idd): + self.idd = idd + ButtonProcessor.__init__(self, window, control_ids) + def OnClicked(self, id): + parent = self.window.hwnd + # Thos form and the other form may "share" options, or at least + # depend on others. So we must save the current form back to the + # options object, display the new dialog, then reload the current + # form from the options object/ + self.window.SaveAllControls() + ShowDialog(parent, self.window.manager, self.idd) + self.window.LoadAllControls() + + def GetPopupHelpText(self, id): + dd = self.window.manager.dialog_parser.dialogs[self.idd] + return "Displays the %s dialog" % dd.caption + dialog_map = { "IDD_MANAGER" : ( From anadelonbrin at users.sourceforge.net Sun Aug 3 19:50:28 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Aug 3 21:50:32 2003 Subject: [Spambayes-checkins] website index.ht,1.17,1.18 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv28485 Modified Files: index.ht Log Message: The links to the mailing lists were broken, so fix those. Also remove the news at the top that's rather stale by now. Index: index.ht =================================================================== RCS file: /cvsroot/spambayes/website/index.ht,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** index.ht 29 Jul 2003 14:33:32 -0000 1.17 --- index.ht 4 Aug 2003 01:50:26 -0000 1.18 *************** *** 6,13 ****

News

Fourth pre-release available. See the download page for more.

-

Spambayes (in particular the Outlook plugin) was recently featured in an - - InfoWorld article, and - Jon Udell's blog.

What is SpamBayes?

--- 6,9 ---- *************** *** 154,158 ****
  • The ! spambayes-announce list - a very low volume mailing list announcing new releases &c.
  • --- 150,154 ----
  • The ! spambayes-announce list - a very low volume mailing list announcing new releases &c.
  • *************** *** 160,177 **** The spambayes user list. General discussions and user queries go here. (This was also the developer list until late May, 2003).
  • ! The spambayes developers list spambayes-dev. This list is for discussion of spambayes development. Please don't use this for user questions ("how do I make SB work with Outlook version X"), use the "spambayes" list for that.
  • ! CVS commit messages go to the list spambayes-checkins.
  • Sourceforge tracker items (bugs, feature requests and patches) ! go to the list spambayes-bugs.
  • --- 156,173 ---- The spambayes user list. General discussions and user queries go here. (This was also the developer list until late May, 2003).
  • ! The spambayes developers list spambayes-dev. This list is for discussion of spambayes development. Please don't use this for user questions ("how do I make SB work with Outlook version X"), use the "spambayes" list for that.
  • ! CVS commit messages go to the list spambayes-checkins.
  • Sourceforge tracker items (bugs, feature requests and patches) ! go to the list spambayes-bugs.
  • From xenogeist at users.sourceforge.net Sun Aug 3 20:40:01 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 3 22:40:04 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources .cvsignore, 1.1.2.1, 1.1.2.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv3495/Outlook2000/dialogs/resources Modified Files: Tag: outlook-dialog-branch .cvsignore Log Message: ignore *.pyc files Index: .cvsignore =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/.cvsignore,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** .cvsignore 4 Aug 2003 01:13:56 -0000 1.1.2.1 --- .cvsignore 4 Aug 2003 02:39:59 -0000 1.1.2.2 *************** *** 1 **** ! dialogs.aps \ No newline at end of file --- 1,2 ---- ! dialogs.aps ! *.pyc \ No newline at end of file From mhammond at users.sourceforge.net Sun Aug 3 20:50:01 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 3 22:50:06 2003 Subject: [Spambayes-checkins] website background.ht,1.15,1.16 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv4597 Modified Files: background.ht Log Message: pipermail archives also lose "-21" on the URL. Index: background.ht =================================================================== RCS file: /cvsroot/spambayes/website/background.ht,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** background.ht 28 May 2003 01:25:14 -0000 1.15 --- background.ht 4 Aug 2003 02:49:59 -0000 1.16 *************** *** 231,235 **** the mailing list archives. Initially, the discussion started on the python-dev list, but then moved to the ! spambayes list. From tim.one at comcast.net Mon Aug 4 00:26:57 2003 From: tim.one at comcast.net (Tim Peters) Date: Sun Aug 3 23:27:24 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resourcesrcparser.py, NONE, 1.1.2.1 In-Reply-To: Message-ID: > Added Files: > Tag: outlook-dialog-branch > rcparser.py > Log Message: > Resource script parser, by Adam Walker. > > > --- NEW FILE: rcparser.py --- > # Windows dialog .RC file parser, by Adam Walker. > > # This module is part of the spambayes project, which is Copyright > 2002 It's 2003 now, according to the new datetime module . From mhammond at users.sourceforge.net Sun Aug 3 22:09:21 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 00:09:24 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rcparser.py, 1.1.2.1, 1.1.2.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv15726/resources Modified Files: Tag: outlook-dialog-branch rcparser.py Log Message: More hacking on the dialogs. Index: rcparser.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/rcparser.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** rcparser.py 4 Aug 2003 01:14:14 -0000 1.1.2.1 --- rcparser.py 4 Aug 2003 04:09:18 -0000 1.1.2.2 *************** *** 1,5 **** # Windows dialog .RC file parser, by Adam Walker. ! # This module is part of the spambayes project, which is Copyright 2002 # The Python Software Foundation and is covered by the Python Software # Foundation license. --- 1,5 ---- # Windows dialog .RC file parser, by Adam Walker. ! # This module is part of the spambayes project, which is Copyright 2003 # The Python Software Foundation and is covered by the Python Software # Foundation license. *************** *** 288,292 **** def test(): from pywin.mfc import dialog ! rcp = ParseDialogs("resources/dialogs.rc") for idName in rcp.dialogs: dlg = dialog.Dialog(rcp.dialogs[idName].createDialogTemplate()) --- 288,292 ---- def test(): from pywin.mfc import dialog ! rcp = ParseDialogs("dialogs.rc") for idName in rcp.dialogs: dlg = dialog.Dialog(rcp.dialogs[idName].createDialogTemplate()) From mhammond at users.sourceforge.net Sun Aug 3 22:09:20 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 00:09:28 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dlgcore.py, 1.1.2.1, 1.1.2.2 dlgutils.py, 1.1.2.1, 1.1.2.2 processors.py, 1.1.2.1, 1.1.2.2 test_dialogs.py, 1.1.2.2, 1.1.2.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv15726 Modified Files: Tag: outlook-dialog-branch dlgcore.py dlgutils.py processors.py test_dialogs.py Log Message: More hacking on the dialogs. Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/dlgcore.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** dlgcore.py 4 Aug 2003 01:15:47 -0000 1.1.2.1 --- dlgcore.py 4 Aug 2003 04:09:18 -0000 1.1.2.2 *************** *** 2,6 **** # Driven completely by "Control Processor" objects. ! # This module is part of the spambayes project, which is Copyright 2002 # The Python Software Foundation and is covered by the Python Software # Foundation license. --- 2,6 ---- # Driven completely by "Control Processor" objects. ! # This module is part of the spambayes project, which is Copyright 2003 # The Python Software Foundation and is covered by the Python Software # Foundation license. *************** *** 98,101 **** --- 98,104 ---- existing.append(instance) + def _GetIDName(self, cid): + return self.manager.dialog_parser.names.get(cid, str(cid)) + def CreateWindow(self): self._DoCreate(win32gui.CreateDialogIndirect) *************** *** 169,173 **** tt_text = cp.GetPopupHelpText(iCtrlId) else: ! print "Can not get command processor for", iCtrlId if tt_text: self.tt.ShowTooltipForControl(iCtrlId, tt_text) --- 172,176 ---- tt_text = cp.GetPopupHelpText(iCtrlId) else: ! print "Can not get command processor for", self._GetIDName(iCtrlId) if tt_text: self.tt.ShowTooltipForControl(iCtrlId, tt_text) *************** *** 214,218 **** handler = self.command_processors.get(idFrom) if handler is None: ! print "Ignoring OnNotify for", idFrom return handler.OnNotify( (hwndFrom, idFrom, code), wparam, lparam) --- 217,221 ---- handler = self.command_processors.get(idFrom) if handler is None: ! print "Ignoring OnNotify for", self._GetIDName(idFrom) return handler.OnNotify( (hwndFrom, idFrom, code), wparam, lparam) *************** *** 223,227 **** handler = self.command_processors.get(id) if handler is None: ! print "Ignoring OnCommand for", id return --- 226,230 ---- handler = self.command_processors.get(id) if handler is None: ! print "Ignoring OnCommand for", self._GetIDName(id) return Index: dlgutils.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/dlgutils.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** dlgutils.py 4 Aug 2003 01:15:47 -0000 1.1.2.1 --- dlgutils.py 4 Aug 2003 04:09:18 -0000 1.1.2.2 *************** *** 8,13 **** return ((h & 0xFFFF) << 16) | (l & 0xFFFF) def SetWaitCursor(wait): ! import win32gui if wait: hCursor = win32gui.LoadCursor(0, win32con.IDC_WAIT) --- 8,15 ---- return ((h & 0xFFFF) << 16) | (l & 0xFFFF) + MAKELPARAM=MAKELONG + def SetWaitCursor(wait): ! import win32gui, win32con if wait: hCursor = win32gui.LoadCursor(0, win32con.IDC_WAIT) Index: processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/processors.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** processors.py 4 Aug 2003 01:15:47 -0000 1.1.2.1 --- processors.py 4 Aug 2003 04:09:18 -0000 1.1.2.2 *************** *** 1,5 **** # Control Processors for our dialog. ! # This module is part of the spambayes project, which is Copyright 2002 # The Python Software Foundation and is covered by the Python Software # Foundation license. --- 1,5 ---- # Control Processors for our dialog. ! # This module is part of the spambayes project, which is Copyright 2003 # The Python Software Foundation and is covered by the Python Software # Foundation license. *************** *** 64,83 **** assert ctrlid == self.control_id return " ".join(self.func.__doc__.split()) - - class DialogCommand(ButtonProcessor): - def __init__(self, window, control_ids, idd): - self.idd = idd - ButtonProcessor.__init__(self, window, control_ids) - def OnClicked(self, id): - parent = self.window.hwnd - # Thos form and the other form may "share" options, or at least - # depend on others. So we must save the current form back to the - # options object, display the new dialog, then reload the current - # form from the options object/ - self.window.SaveAllControls() - ShowDialog(parent, self.window.manager, self.idd) - self.window.LoadAllControls() - - def GetPopupHelpText(self, id): - dd = self.window.manager.dialog_parser.dialogs[self.idd] - return "Displays the %s dialog" % dd.caption --- 64,65 ---- Index: test_dialogs.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/test_dialogs.py,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** test_dialogs.py 4 Aug 2003 01:42:27 -0000 1.1.2.2 --- test_dialogs.py 4 Aug 2003 04:09:18 -0000 1.1.2.3 *************** *** 65,71 **** return "Displays the %s dialog" % dd.caption dialog_map = { "IDD_MANAGER" : ( ! (CloseButtonProcessor, "IDOK"), (VersionStringProcessor, "IDC_VERSION"), (BoolButtonProcessor, "IDC_BUT_TRAIN_FROM_SPAM_FOLDER", --- 65,85 ---- return "Displays the %s dialog" % dd.caption + from async_processor import AsyncCommandProcessor + + def test_async(manager, progress): + import time + progress.set_max_ticks(10) + for i in range(10): + progress.set_status("Number %d" % i) + progress.tick() + time.sleep(1) + if progress.stop_requested(): + break + progress.set_status("Finished") + + dialog_map = { "IDD_MANAGER" : ( ! (CloseButtonProcessor, "IDOK IDCANCEL"), (VersionStringProcessor, "IDC_VERSION"), (BoolButtonProcessor, "IDC_BUT_TRAIN_FROM_SPAM_FOLDER", *************** *** 79,83 **** ), "IDD_FILTER_NOW" : ( ! (CloseButtonProcessor, "IDOK"), (BoolButtonProcessor, "IDC_BUT_UNREAD", "Filter_Now.only_unread"), (BoolButtonProcessor, "IDC_BUT_UNSEEN", "Filter_Now.only_unseen"), --- 93,97 ---- ), "IDD_FILTER_NOW" : ( ! (CloseButtonProcessor, "IDOK IDCANCEL"), (BoolButtonProcessor, "IDC_BUT_UNREAD", "Filter_Now.only_unread"), (BoolButtonProcessor, "IDC_BUT_UNSEEN", "Filter_Now.only_unseen"), *************** *** 87,93 **** "Filter_Now.folder_ids", "Filter_Now.include_sub"), ), "IDD_FILTER" : ( ! (CloseButtonProcessor, "IDOK"), (FolderIDProcessor, "IDC_FOLDER_WATCH IDC_BROWSE_WATCH", "Filter.watch_folder_ids", --- 101,111 ---- "Filter_Now.folder_ids", "Filter_Now.include_sub"), + (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", + test_async, "Start Filtering", "Stop Filtering", + "IDC_BUT_UNSEEN IDC_BUT_UNREAD IDC_BROWSE " \ + "IDOK IDC_BUT_ACT_SCORE IDC_BUT_ACT_ALL"), ), "IDD_FILTER" : ( ! (CloseButtonProcessor, "IDOK IDCANCEL"), (FolderIDProcessor, "IDC_FOLDER_WATCH IDC_BROWSE_WATCH", "Filter.watch_folder_ids", *************** *** 109,113 **** ), "IDD_TRAINING" : ( ! (CloseButtonProcessor, "IDOK"), (FolderIDProcessor, "IDC_STATIC_HAM IDC_BROWSE_HAM", "Training.ham_folder_ids", --- 127,131 ---- ), "IDD_TRAINING" : ( ! (CloseButtonProcessor, "IDOK IDCANCEL"), (FolderIDProcessor, "IDC_STATIC_HAM IDC_BROWSE_HAM", "Training.ham_folder_ids", From mhammond at users.sourceforge.net Sun Aug 3 22:09:58 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 00:10:02 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs async_processor.py, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv15797 Added Files: Tag: outlook-dialog-branch async_processor.py Log Message: An async command processor that will do the threading magic. --- NEW FILE: async_processor.py --- # An async command processor from dlgutils import * import win32gui, win32api, win32con, commctrl import win32process import processors try: True, False except NameError: # Maintain compatibility with Python 2.2 True, False = 1, 0 IDC_START = 1100 IDC_PROGRESS = 1101 IDC_PROGRESS_TEXT = 1102 MYWM_SETSTATUS = win32con.WM_USER+11 MYWM_SETWARNING = win32con.WM_USER+12 MYWM_SETERROR = win32con.WM_USER+13 MYWM_FINISHED = win32con.WM_USER+14 # This is called from another thread - hence we need to jump through hoops! class _Progress: def __init__(self, processor): self.hdlg = processor.window.hwnd self.hprogress = processor.GetControl(processor.statusbar_id) self.processor = processor self.stopping = False self.total_control_ticks = 100 self.current_stage = 0 self.set_stages( (("", 1.0),) ) def set_stages(self, stages): self.stages = [] start_pos = 0.0 for name, prop in stages: stage = name, start_pos, prop start_pos += prop self.stages.append(stage) assert abs(start_pos-1.0) < 0.001, ( "Proportions must add to 1.0 (%r,%r,%r)" % (start_pos, stages, start_pos-1.0)) def _next_stage(self): if self.current_stage == 0: win32api.PostMessage(self.hprogress, commctrl.PBM_SETRANGE, 0, MAKELPARAM(0,self.total_control_ticks)) win32api.PostMessage(self.hprogress, commctrl.PBM_SETSTEP, 1, 0) win32api.PostMessage(self.hprogress, commctrl.PBM_SETPOS, 0, 0) self.current_control_tick = 0 self.current_stage += 1 assert self.current_stage <= len(self.stages) def _get_current_stage(self): return self.stages[self.current_stage-1] def set_max_ticks(self, m): self._next_stage() self.current_stage_tick = 0 self.current_stage_max = m def tick(self): self.current_stage_tick += 1 # Calc how far through this stage. this_prop = float(self.current_stage_tick) / self.current_stage_max # How far through the total. stage_name, start, end = self._get_current_stage() # Calc the perc of the total control. stage_name, start, prop = self._get_current_stage() total_prop = start + this_prop * prop # How may ticks is this on the control control_tick = int(total_prop * self.total_control_ticks) #print "Tick", self.current_stage_tick, "is", this_prop, "through the stage,", total_prop, "through the total - ctrl tick is", control_tick while self.current_control_tick < control_tick: self.current_control_tick += 1 #print "ticking control", self.current_control_tick win32api.PostMessage(self.hprogress, commctrl.PBM_STEPIT, 0, 0) def _get_stage_text(self, text): stage_name, start, end = self._get_current_stage() if stage_name: text = stage_name + ": " + text return text def set_status(self, text): self.processor.progress_status = self._get_stage_text(text) win32api.PostMessage(self.hdlg, MYWM_SETSTATUS) def warning(self, text): self.processor.progress_warning = self._get_stage_text(text) win32api.PostMessage(self.hdlg, MYWM_SETWARNING) def error(self, text): self.processor.progress_error = self._get_stage_text(text) win32api.PostMessage(self.hdlg, MYWM_SETERROR) def request_stop(self): self.stopping = True def stop_requested(self): return self.stopping class AsyncCommandProcessor(processors.CommandButtonProcessor): def __init__(self, window, control_ids, func, start_text, stop_text, disable_ids): processors.CommandButtonProcessor.__init__(self, window, control_ids[:1], func, ()) self.progress_status = "" self.progress_error = "" self.progress_warning = "" self.running = False self.statusbar_id = control_ids[1] self.statustext_id = control_ids[2] self.process_start_text = start_text self.process_stop_text = stop_text dids = self.disable_while_running_ids = [] for id in disable_ids.split(): dids.append(window.manager.dialog_parser.ids[id]) def Init(self): win32gui.ShowWindow(self.GetControl(self.statusbar_id), win32con.SW_HIDE) self.SetStatusText("") def GetMessages(self): return [MYWM_SETSTATUS, MYWM_SETWARNING, MYWM_SETERROR, MYWM_FINISHED] def SetEnabledStates(self, enabled): for id in self.disable_while_running_ids: win32gui.EnableWindow(self.GetControl(id), enabled) def OnMessage(self, msg, wparam, lparam): if msg == MYWM_SETSTATUS: self.OnProgressStatus(wparam, lparam) elif msg == MYWM_SETWARNING: self.OnProgressWarning(wparam, lparam) elif msg == MYWM_SETERROR: self.OnProgressError(wparam, lparam) elif msg == MYWM_FINISHED: self.OnFinished(wparam, lparam) else: raise RuntimeError, "Not one of my messages??" def OnFinished(self, wparam, lparam): self.seen_finished = True wasCancelled = wparam self.SetEnabledStates(True) win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, self.process_start_text) win32gui.ShowWindow(self.GetControl(self.statusbar_id), win32con.SW_HIDE) if wasCancelled: self.SetStatusText("Cancelled") def SetStatusText(self, text): win32gui.SendMessage(self.GetControl(self.statustext_id), win32con.WM_SETTEXT, 0, text) def OnProgressStatus(self, wparam, lparam): self.SetStatusText(self.progress_status) def OnProgressError(self, wparam, lparam): self.SetStatusText(self.progress_error) win32gui.MessageBox(self.window.hwnd, self.progress_error, "SpamBayes", win32con.MB_OK | win32con.MB_ICONEXCLAMATION) if not self.running and not self.seen_finished: self.OnFinished(0,0) def OnProgressWarning(self, wparam, lparam): pass def OnClicked(self, id): self.StartProcess() def StartProcess(self): if self.running: self.progress.request_stop() else: # Do anything likely to fail before we screw around with the # control states - this way the dialog doesn't look as 'dead' progress=_Progress(self) # Now screw around with the control states, restored when # the thread terminates. self.SetEnabledStates(False) win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, self.process_stop_text) win32gui.SendMessage(self.GetControl(self.statustext_id), win32con.WM_SETTEXT, 0, "") win32gui.ShowWindow(self.GetControl(self.statusbar_id), win32con.SW_SHOW) # Local function for the thread target that notifies us when finished. def thread_target(h, progress): try: self.progress = progress self.seen_finished = False self.running = True # Drop my thread priority, so outlook can keep repainting # and doing its stuff without getting stressed. import win32process, win32api THREAD_PRIORITY_BELOW_NORMAL=-1 win32process.SetThreadPriority(win32api.GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL) self.func( self.window.manager, progress) finally: win32api.PostMessage(h, MYWM_FINISHED, self.progress.stop_requested()) self.running = False self.progress = None # back to the program :) import threading t = threading.Thread(target=thread_target, args =(self.window.hwnd, progress)) t.start() if __name__=='__main__': # Test my "multi-stage" code class HackProgress(_Progress): def __init__(self): # dont use dlg self.hprogress = self.hdlg = 0 self.dlg = None self.stopping = False self.total_control_ticks = 100 self.current_stage = 0 self.set_stages( (("", 1.0),) ) p = HackProgress() p.set_max_ticks(10) for i in range(10): p.tick() p = HackProgress() stages = ("Stage 1", 0.2), ("Stage 2", 0.8) p.set_stages(stages) # Do stage 1 p.set_max_ticks(10) for i in range(10): p.tick() # Do stage 2 p.set_max_ticks(1000) for i in range(1000): p.tick() print "Done!" From mhammond at users.sourceforge.net Sun Aug 3 23:20:45 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 01:20:49 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dlgcore.py, 1.1.2.2, 1.1.2.3 opt_processors.py, 1.1.2.1, 1.1.2.2 processors.py, 1.1.2.2, 1.1.2.3 test_dialogs.py, 1.1.2.3, 1.1.2.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv24720 Modified Files: Tag: outlook-dialog-branch dlgcore.py opt_processors.py processors.py test_dialogs.py Log Message: Back off from having each processor keep a copy of the value in self.value. This made is very difficult to make controls "depend" on each other. Added "enable filtering" (which uses the same smarts as the trunk) and 2 status processors. Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/dlgcore.py,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** dlgcore.py 4 Aug 2003 04:09:18 -0000 1.1.2.2 --- dlgcore.py 4 Aug 2003 05:20:43 -0000 1.1.2.3 *************** *** 111,114 **** --- 111,121 ---- p.OnMessage(msg, wparam, lparam) + # Called back by a processor when it changes an option. We tell all other + # options on our page that the value changed. + def OnOptionChanged(self, changed_by, option): + for p in self.all_processors: + if p is not changed_by: + p.OnOptionChanged(option) + def GetMessageMap(self): ret = { *************** *** 186,190 **** for p in self.all_processors: try: ! p.Done(True) except ValueError, why: mb_flags = win32con.MB_ICONEXCLAMATION | win32con.MB_OK --- 193,197 ---- for p in self.all_processors: try: ! p.Done() except ValueError, why: mb_flags = win32con.MB_ICONEXCLAMATION | win32con.MB_OK Index: opt_processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/opt_processors.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** opt_processors.py 4 Aug 2003 01:15:47 -0000 1.1.2.1 --- opt_processors.py 4 Aug 2003 05:20:43 -0000 1.1.2.2 *************** *** 23,27 **** else: self.option = None - self.value = None def GetPopupHelpText(self, idFrom): --- 23,26 ---- *************** *** 29,52 **** # We override Init, and break it into 2 steps. - # - Load option into self.value - # - set the control from self.value. def Init(self): - self.LoadOptionValue() self.UpdateControl_FromValue() ! # We override Done into 2 similar steps ! # - Update self.value from the current contents of the control. ! # - Write self.value back to the option. ! def Done(self, saving): ! if saving: ! self.UpdateValue_FromControl() ! self.StoreOptionValue() ! def LoadOptionValue(self): ! self.value = self.option.get() ! def StoreOptionValue(self): ! print "Setting", self.option.name, "to", self.value ! self.option.set(self.value) # Only sub-classes know how to update their controls from the value. --- 28,49 ---- # We override Init, and break it into 2 steps. def Init(self): self.UpdateControl_FromValue() ! def Done(self): ! self.UpdateValue_FromControl() ! def NotifyOptionChanged(self, option = None): ! if option is None: ! option = self.option ! self.window.OnOptionChanged(self, option) ! def SetOptionValue(self, value, option = None): ! if option is None: ! option = self.option ! print "Setting option '%s' (%s) -> %s" % \ ! (option.display_name(), option.name, value) ! option.set(value) ! self.NotifyOptionChanged(option) # Only sub-classes know how to update their controls from the value. *************** *** 56,60 **** raise NotImplementedError ! # "Bool" buttons are simple - just toggle self.value on the click. # (Little more complex to handle "radio buttons" that are also boolean # where we must "uncheck" the other button. --- 53,57 ---- raise NotImplementedError ! # "Bool" buttons are simple - just toggle the value on the click. # (Little more complex to handle "radio buttons" that are also boolean # where we must "uncheck" the other button. *************** *** 65,75 **** self.UpdateValue_FromControl() def UpdateControl_FromValue(self): ! win32gui.SendMessage(self.GetControl(), win32con.BM_SETCHECK, self.value) for other in self.other_ids: ! win32gui.SendMessage(self.GetControl(other), win32con.BM_SETCHECK, not self.value) def UpdateValue_FromControl(self): check = win32gui.SendMessage(self.GetControl(), win32con.BM_GETCHECK) check = not not check # force bool! ! self.value = check # A "Combo" processor, that loads valid strings from the option. --- 62,73 ---- self.UpdateValue_FromControl() def UpdateControl_FromValue(self): ! value = self.option.get() ! win32gui.SendMessage(self.GetControl(), win32con.BM_SETCHECK, value) for other in self.other_ids: ! win32gui.SendMessage(self.GetControl(other), win32con.BM_SETCHECK, not value) def UpdateValue_FromControl(self): check = win32gui.SendMessage(self.GetControl(), win32con.BM_GETCHECK) check = not not check # force bool! ! self.SetOptionValue(check) # A "Combo" processor, that loads valid strings from the option. *************** *** 79,85 **** combo = self.GetControl() index = sel_index = 0 for s in self.option.valid_input(): win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, s) ! if self.value.startswith(s): sel_index = index index += 1 --- 77,84 ---- combo = self.GetControl() index = sel_index = 0 + value = self.option.get() for s in self.option.valid_input(): win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, s) ! if value.startswith(s): sel_index = index index += 1 *************** *** 93,98 **** win32gui.SendMessage(combo, win32con.CB_GETLBTEXT, sel, buffer) # Trim the \0 from the end. ! self.value = buffer.tostring()[:-1] ! print "Combo gave me", self.value class EditNumberProcessor(OptionControlProcessor): --- 92,96 ---- win32gui.SendMessage(combo, win32con.CB_GETLBTEXT, sel, buffer) # Trim the \0 from the end. ! self.SetOptionValue(buffer.tostring()[:-1]) class EditNumberProcessor(OptionControlProcessor): *************** *** 142,146 **** def UpdateControl_FromValue(self): ! win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, str(self.value)) self.UpdateSlider_FromEdit() --- 140,144 ---- def UpdateControl_FromValue(self): ! win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, str(self.option.get())) self.UpdateSlider_FromEdit() *************** *** 150,154 **** # Get as float so we dont fail should the .0 be there, but # then convert to int as the slider only works with ints ! val = int(float(self.value)) except ValueError: return --- 148,152 ---- # Get as float so we dont fail should the .0 be there, but # then convert to int as the slider only works with ints ! val = int(float(self.option.get())) except ValueError: return *************** *** 164,168 **** if val < 0 or val > 100: raise ValueError, "Value must be between 0 and 100" ! self.value = val # Folder IDs, and the "include_sub" option, if applicable. --- 162,166 ---- if val < 0 or val > 100: raise ValueError, "Value must be between 0 and 100" ! self.SetOptionValue(val) # Folder IDs, and the "include_sub" option, if applicable. *************** *** 181,194 **** OptionControlProcessor.__init__(self, window, control_ids, option) - def LoadOptionValue(self): - self.value = self.option.get() - if self.option_include_sub: - self.value_include_sub = self.option_include_sub.get() - - def StoreOptionValue(self): - self.option.set(self.value) - if self.option_include_sub: - self.option_include_sub.set(self.value_include_sub) - def OnCommand(self, wparam, lparam): mgr = self.window.manager --- 179,182 ---- *************** *** 197,206 **** is_multi = self.option.multiple_values_allowed() if is_multi: ! ids = self.value else: ! ids = [self.value] from dialogs import FolderSelector if self.option_include_sub: ! cb_state = self.value_include_sub else: cb_state = None # don't show it. --- 185,194 ---- is_multi = self.option.multiple_values_allowed() if is_multi: ! ids = self.option.get() else: ! ids = [self.optin.get()] from dialogs import FolderSelector if self.option_include_sub: ! cb_state = self.option_include_sub.get() else: cb_state = None # don't show it. *************** *** 212,220 **** ids, include_sub = d.GetSelectedIDs() if is_multi: ! self.value = ids else: ! self.value = ids[0] if self.option_include_sub: ! self.value_include_sub = include_sub self.UpdateControl_FromValue() --- 200,208 ---- ids, include_sub = d.GetSelectedIDs() if is_multi: ! self.SetOptionValue(ids) else: ! self.SetOptionValue(ids[0]) if self.option_include_sub: ! self.SetOptionValue(include_sub, self.option_include_sub) self.UpdateControl_FromValue() *************** *** 228,234 **** mgr = self.window.manager if self.option.multiple_values_allowed(): ! ids = self.value else: ! ids = [self.value] names = [] for eid in ids: --- 216,222 ---- mgr = self.window.manager if self.option.multiple_values_allowed(): ! ids = self.option.get() else: ! ids = [self.option.get()] names = [] for eid in ids: *************** *** 242,246 **** def UpdateValue_FromControl(self): - # We only update our self.value via the dialog, so - # no need to copy control value to self.value. pass --- 230,232 ---- Index: processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/processors.py,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** processors.py 4 Aug 2003 04:09:18 -0000 1.1.2.2 --- processors.py 4 Aug 2003 05:20:43 -0000 1.1.2.3 *************** *** 19,23 **** def Init(self): pass ! def Done(self, saving): pass def GetControl(self, control_id = None): --- 19,23 ---- def Init(self): pass ! def Done(self): pass def GetControl(self, control_id = None): *************** *** 34,37 **** --- 34,39 ---- def OnMessage(self, msg, wparam, lparam): raise RuntimeError, "I don't hook any messages, so I shouldn't be called" + def OnOptionChanged(self, option): + pass class ButtonProcessor(ControlProcessor): Index: test_dialogs.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/test_dialogs.py,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** test_dialogs.py 4 Aug 2003 04:09:18 -0000 1.1.2.3 --- test_dialogs.py 4 Aug 2003 05:20:43 -0000 1.1.2.4 *************** *** 26,29 **** --- 26,87 ---- return "The version of SpamBayes running" + class TrainingStatusProcessor(ControlProcessor): + def Init(self): + bayes = self.window.manager.bayes + 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" + win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, + 0, db_status) + + class FilterEnableProcessor(BoolButtonProcessor): + def UpdateValue_FromControl(self): + check = win32gui.SendMessage(self.GetControl(), win32con.BM_GETCHECK) + if check: + reason = self.window.manager.GetDisabledReason() + if reason is not None: + raise ValueError, reason + check = not not check # force bool! + self.SetOptionValue(check) + + class FilterStatusProcessor(ControlProcessor): + def OnOptionChanged(self, option): + self.Init() + + def Init(self): + manager = self.window.manager + reason = manager.GetDisabledReason() + if reason is not None: + win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, + 0, status) + 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) + return + # ok, enabled and working - put together the status text. + config = manager.config.filter + certain_spam_name = manager.FormatFolderNames( + [config.spam_folder_id], False) + if config.unsure_folder_id: + unsure_name = manager.FormatFolderNames( + [config.unsure_folder_id], False) + unsure_text = "unsure managed in '%s'" % (unsure_name,) + else: + unsure_text = "unsure messages untouched" + + watch_names = manager.FormatFolderNames( + config.watch_folder_ids, config.watch_include_sub) + filter_status = "Watching '%s'. Spam managed in '%s', %s" \ + % (watch_names, + certain_spam_name, + unsure_text) + win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, + 0, filter_status) + def ShowAbout(mgr): """Displays the main SpamBayes documentation in your Web browser""" *************** *** 83,86 **** --- 141,147 ---- (CloseButtonProcessor, "IDOK IDCANCEL"), (VersionStringProcessor, "IDC_VERSION"), + (TrainingStatusProcessor, "IDC_TRAINING_STATUS"), + (FilterEnableProcessor, "IDC_BUT_FILTER_ENABLE", "Filter.enabled"), + (FilterStatusProcessor, "IDC_FILTER_STATUS"), (BoolButtonProcessor, "IDC_BUT_TRAIN_FROM_SPAM_FOLDER", "Training.train_recovered_spam"), From mhammond at users.sourceforge.net Sun Aug 3 23:29:26 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 01:29:28 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dlgcore.py, 1.1.2.3, 1.1.2.4 opt_processors.py, 1.1.2.2, 1.1.2.3 test_dialogs.py, 1.1.2.4, 1.1.2.5 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv26004 Modified Files: Tag: outlook-dialog-branch dlgcore.py opt_processors.py test_dialogs.py Log Message: Fix the "enabled/disabled" code. Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/dlgcore.py,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** dlgcore.py 4 Aug 2003 05:20:43 -0000 1.1.2.3 --- dlgcore.py 4 Aug 2003 05:29:23 -0000 1.1.2.4 *************** *** 190,201 **** p.Init() def SaveAllControls(self): for p in self.all_processors: ! try: ! p.Done() ! except ValueError, why: ! mb_flags = win32con.MB_ICONEXCLAMATION | win32con.MB_OK ! win32gui.MessageBox(self.hwnd, str(why), ! self.dialog_def.caption, mb_flags) win32gui.SetFocus(p.GetControl()) return False --- 190,206 ---- p.Init() + def ApplyHandlingOptionValueError(self, func, *args): + try: + func(*args) + return True + except ValueError, why: + mb_flags = win32con.MB_ICONEXCLAMATION | win32con.MB_OK + win32gui.MessageBox(self.hwnd, str(why), + self.dialog_def.caption, mb_flags) + return False + def SaveAllControls(self): for p in self.all_processors: ! if not self.ApplyHandlingOptionValueError(p.Done): win32gui.SetFocus(p.GetControl()) return False *************** *** 236,238 **** return ! handler.OnCommand(wparam, lparam) --- 241,243 ---- return ! self.ApplyHandlingOptionValueError(handler.OnCommand, wparam, lparam) Index: opt_processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/opt_processors.py,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** opt_processors.py 4 Aug 2003 05:20:43 -0000 1.1.2.2 --- opt_processors.py 4 Aug 2003 05:29:23 -0000 1.1.2.3 *************** *** 221,230 **** names = [] for eid in ids: ! folder = mgr.message_store.GetFolder(eid) ! if folder is None: ! name = "" ! else: ! name = folder.name ! names.append(name) win32gui.SetWindowText(self.GetControl(), "; ".join(names)) --- 221,231 ---- names = [] for eid in ids: ! if eid is not None: ! folder = mgr.message_store.GetFolder(eid) ! if folder is None: ! name = "" ! else: ! name = folder.name ! names.append(name) win32gui.SetWindowText(self.GetControl(), "; ".join(names)) Index: test_dialogs.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/test_dialogs.py,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** test_dialogs.py 4 Aug 2003 05:20:43 -0000 1.1.2.4 --- test_dialogs.py 4 Aug 2003 05:29:23 -0000 1.1.2.5 *************** *** 44,47 **** --- 44,48 ---- reason = self.window.manager.GetDisabledReason() if reason is not None: + win32gui.SendMessage(self.GetControl(), win32con.BM_SETCHECK, 0) raise ValueError, reason check = not not check # force bool! *************** *** 57,61 **** if reason is not None: win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, ! 0, status) return if not manager.config.filter.enabled: --- 58,62 ---- if reason is not None: win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, ! 0, reason) return if not manager.config.filter.enabled: From mhammond at users.sourceforge.net Sun Aug 3 23:30:00 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 01:30:03 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 manager.py, 1.69, 1.69.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv26053 Modified Files: Tag: outlook-dialog-branch manager.py Log Message: Move the logic for "can we be enabled" from the dialog back into the manager. Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.69 retrieving revision 1.69.2.1 diff -C2 -d -r1.69 -r1.69.2.1 *** manager.py 30 Jul 2003 03:22:51 -0000 1.69 --- manager.py 4 Aug 2003 05:29:58 -0000 1.69.2.1 *************** *** 7,10 **** --- 7,11 ---- import shutil import traceback + import operator import win32api, win32con, win32ui *************** *** 687,690 **** --- 688,719 ---- self.ReportErrorOnce(msg) raise + + def GetDisabledReason(self): + # Gets the reason why the plugin can not be enabled. + # If return is None, then it can be enabled (and indeed may be!) + # Otherwise return is the string reason + nspam = self.bayes.nspam + nham = self.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) + if not ok_to_enable: + return "You must define the folder to receive your certain spam" + + return None def ShowManager(self): From mhammond at users.sourceforge.net Mon Aug 4 00:54:36 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 02:54:39 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.1.2.1, 1.1.2.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv4710/resources Modified Files: Tag: outlook-dialog-branch dialogs.rc Log Message: Had 2 controls: IDC_BUT_FILTERNOW and IDC_BUT_FILTER_NOW - now only IDC_BUT_FILTER_NOW Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/dialogs.rc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** dialogs.rc 4 Aug 2003 01:13:56 -0000 1.1.2.1 --- dialogs.rc 4 Aug 2003 06:54:34 -0000 1.1.2.2 *************** *** 164,168 **** LTEXT "All other messages are considered good, and are not filtered", IDC_STATIC,14,196,212,10 ! PUSHBUTTON "Filter Now...",IDC_BUT_FILTERNOW,7,218,50,14 PUSHBUTTON "Close",IDOK,192,218,50,14 END --- 164,168 ---- LTEXT "All other messages are considered good, and are not filtered", IDC_STATIC,14,196,212,10 ! PUSHBUTTON "Filter Now...",IDC_BUT_FILTER_NOW,7,218,50,14 PUSHBUTTON "Close",IDOK,192,218,50,14 END From mhammond at users.sourceforge.net Mon Aug 4 00:55:21 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 02:55:27 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs test_dialogs.py, 1.1.2.5, 1.1.2.6 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv4759 Modified Files: Tag: outlook-dialog-branch test_dialogs.py Log Message: Plug in all the "async" commands. This should make the new test dialogs completely functional (but still only from outside SpamBayes) Index: test_dialogs.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/test_dialogs.py,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** test_dialogs.py 4 Aug 2003 05:29:23 -0000 1.1.2.5 --- test_dialogs.py 4 Aug 2003 06:55:19 -0000 1.1.2.6 *************** *** 126,140 **** from async_processor import AsyncCommandProcessor ! def test_async(manager, progress): ! import time ! progress.set_max_ticks(10) ! for i in range(10): ! progress.set_status("Number %d" % i) ! progress.tick() ! time.sleep(1) ! if progress.stop_requested(): ! break ! progress.set_status("Finished") ! dialog_map = { --- 126,130 ---- from async_processor import AsyncCommandProcessor ! import filter, train dialog_map = { *************** *** 164,168 **** "Filter_Now.include_sub"), (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", ! test_async, "Start Filtering", "Stop Filtering", "IDC_BUT_UNSEEN IDC_BUT_UNREAD IDC_BROWSE " \ "IDOK IDC_BUT_ACT_SCORE IDC_BUT_ACT_ALL"), --- 154,158 ---- "Filter_Now.include_sub"), (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", ! filter.filterer, "Start Filtering", "Stop Filtering", "IDC_BUT_UNSEEN IDC_BUT_UNREAD IDC_BROWSE " \ "IDOK IDC_BUT_ACT_SCORE IDC_BUT_ACT_ALL"), *************** *** 198,201 **** --- 188,195 ---- (BoolButtonProcessor, "IDC_BUT_RESCORE", "Training.rescore"), (BoolButtonProcessor, "IDC_BUT_REBUILD", "Training.rebuild"), + (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", + train.trainer, "Start Training", "Stop", + "IDC_BROWSE_HAM IDC_BROWSE_SPAM " \ + "IDC_BUT_REBUILD IDC_BUT_RESCORE"), ) } From mhammond at users.sourceforge.net Mon Aug 4 00:56:19 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 02:56:22 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 train.py,1.27,1.27.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv5061 Modified Files: Tag: outlook-dialog-branch train.py Log Message: Main training callback uses args from config, not passed in. Index: train.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/train.py,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -C2 -d -r1.27 -r1.27.2.1 *** train.py 15 May 2003 22:52:00 -0000 1.27 --- train.py 4 Aug 2003 06:56:17 -0000 1.27.2.1 *************** *** 98,103 **** # Called back from the dialog to do the actual training. ! def trainer(mgr, progress, rebuild, rescore = True): config = mgr.config if not config.training.ham_folder_ids or not config.training.spam_folder_ids: --- 98,105 ---- # Called back from the dialog to do the actual training. ! def trainer(mgr, progress): config = mgr.config + rebuild = config.training.rebuild + rescore = config.training.rescore if not config.training.ham_folder_ids or not config.training.spam_folder_ids: From mhammond at users.sourceforge.net Mon Aug 4 01:21:16 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 03:21:20 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 manager.py, 1.69.2.1, 1.69.2.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv8156 Modified Files: Tag: outlook-dialog-branch manager.py Log Message: Brutal! Delete the old dialogs, and the manager now shows the new ones inside outlook! Not modal though. Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.69.2.1 retrieving revision 1.69.2.2 diff -C2 -d -r1.69.2.1 -r1.69.2.2 *** manager.py 4 Aug 2003 05:29:58 -0000 1.69.2.1 --- manager.py 4 Aug 2003 07:21:14 -0000 1.69.2.2 *************** *** 200,203 **** --- 200,204 ---- self.stats = Stats() self.outlook = outlook + self.dialog_parser = None import_early_core_spambayes_stuff() *************** *** 718,744 **** def ShowManager(self): ! def do_train(dlg): ! import train ! import dialogs.TrainingDialog ! d = dialogs.TrainingDialog.TrainingDialog(dlg.mgr, train.trainer) ! d.DoModal() ! ! def do_filter(dlg): ! import filter ! import dialogs.FilterDialog ! d = dialogs.FilterDialog.FilterNowDialog(dlg.mgr, filter.filterer) ! d.DoModal() ! ! def define_filter(dlg): ! import filter ! import dialogs.FilterDialog ! d = dialogs.FilterDialog.FilterArrivalsDialog(dlg.mgr, filter.filterer) ! d.DoModal() ! if dlg.mgr.addin is not None: ! dlg.mgr.addin.FiltersChanged() ! ! import dialogs.ManagerDialog ! d = dialogs.ManagerDialog.ManagerDialog(self, do_train, do_filter, define_filter) ! d.DoModal() # And re-save now, just incase Outlook dies on the way down. self.SaveConfig() --- 719,725 ---- def ShowManager(self): ! import dialogs ! # Need to get the plugin hwnd ! dialogs.ShowDialog(0, self, "IDD_MANAGER") # And re-save now, just incase Outlook dies on the way down. self.SaveConfig() From mhammond at users.sourceforge.net Mon Aug 4 01:21:17 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 03:21:21 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, NONE, 1.1.2.1 __init__.py, 1.2, 1.2.4.1 test_dialogs.py, 1.1.2.6, 1.1.2.7 AsyncDialog.py, 1.8, NONE DialogGlobals.py, 1.1, NONE FilterDialog.py, 1.20, NONE ManagerDialog.py, 1.10, NONE TrainingDialog.py, 1.13, NONE Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv8156/dialogs Modified Files: Tag: outlook-dialog-branch __init__.py test_dialogs.py Added Files: Tag: outlook-dialog-branch dialog_map.py Removed Files: Tag: outlook-dialog-branch AsyncDialog.py DialogGlobals.py FilterDialog.py ManagerDialog.py TrainingDialog.py Log Message: Brutal! Delete the old dialogs, and the manager now shows the new ones inside outlook! Not modal though. --- NEW FILE: dialog_map.py --- # This module is part of the spambayes project, which is Copyright 2003 # The Python Software Foundation and is covered by the Python Software # Foundation license. from processors import * from opt_processors import * from dialogs import ShowDialog # "dialog specific" processors: class VersionStringProcessor(ControlProcessor): def Init(self): from spambayes.Version import get_version_string import sys version_key = "Full Description" if hasattr(sys, "frozen"): version_key += " Binary" version_string = get_version_string("Outlook", version_key) win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, version_string) def GetPopupHelpText(self, cid): return "The version of SpamBayes running" class TrainingStatusProcessor(ControlProcessor): def Init(self): bayes = self.window.manager.bayes 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" win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, db_status) class FilterEnableProcessor(BoolButtonProcessor): def UpdateValue_FromControl(self): check = win32gui.SendMessage(self.GetControl(), win32con.BM_GETCHECK) if check: reason = self.window.manager.GetDisabledReason() if reason is not None: win32gui.SendMessage(self.GetControl(), win32con.BM_SETCHECK, 0) raise ValueError, reason check = not not check # force bool! self.SetOptionValue(check) class FilterStatusProcessor(ControlProcessor): def OnOptionChanged(self, option): self.Init() def Init(self): manager = self.window.manager reason = manager.GetDisabledReason() if reason is not None: win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, reason) 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) return # ok, enabled and working - put together the status text. config = manager.config.filter certain_spam_name = manager.FormatFolderNames( [config.spam_folder_id], False) if config.unsure_folder_id: unsure_name = manager.FormatFolderNames( [config.unsure_folder_id], False) unsure_text = "unsure managed in '%s'" % (unsure_name,) else: unsure_text = "unsure messages untouched" watch_names = manager.FormatFolderNames( config.watch_folder_ids, config.watch_include_sub) filter_status = "Watching '%s'. Spam managed in '%s', %s" \ % (watch_names, certain_spam_name, unsure_text) win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, filter_status) def ShowAbout(mgr): """Displays the main SpamBayes documentation in your Web browser""" import sys, os if hasattr(sys, "frozen"): # Same directory as to the executable. fname = os.path.join(os.path.dirname(sys.argv[0]), "about.html") else: # In the parent (ie, main Outlook2000) dir fname = os.path.join(os.path.dirname(__file__), os.pardir, "about.html") fname = os.path.abspath(fname) if os.path.isfile(fname): SetWaitCursor(1) os.startfile(fname) SetWaitCursor(0) else: print "Cant find about - fix messagebox" self.MessageBox("Can't find about.html") class DialogCommand(ButtonProcessor): def __init__(self, window, control_ids, idd): self.idd = idd ButtonProcessor.__init__(self, window, control_ids) def OnClicked(self, id): parent = self.window.hwnd # Thos form and the other form may "share" options, or at least # depend on others. So we must save the current form back to the # options object, display the new dialog, then reload the current # form from the options object/ self.window.SaveAllControls() ShowDialog(parent, self.window.manager, self.idd) self.window.LoadAllControls() def GetPopupHelpText(self, id): dd = self.window.manager.dialog_parser.dialogs[self.idd] return "Displays the %s dialog" % dd.caption from async_processor import AsyncCommandProcessor import filter, train dialog_map = { "IDD_MANAGER" : ( (CloseButtonProcessor, "IDOK IDCANCEL"), (VersionStringProcessor, "IDC_VERSION"), (TrainingStatusProcessor, "IDC_TRAINING_STATUS"), (FilterEnableProcessor, "IDC_BUT_FILTER_ENABLE", "Filter.enabled"), (FilterStatusProcessor, "IDC_FILTER_STATUS"), (BoolButtonProcessor, "IDC_BUT_TRAIN_FROM_SPAM_FOLDER", "Training.train_recovered_spam"), (BoolButtonProcessor, "IDC_BUT_TRAIN_TO_SPAM_FOLDER", "Training.train_manual_spam"), (DialogCommand, "IDC_BUT_FILTER_NOW", "IDD_FILTER_NOW"), (DialogCommand, "IDC_BUT_FILTER_DEFINE", "IDD_FILTER"), (DialogCommand, "IDC_BUT_TRAIN_NOW", "IDD_TRAINING"), (CommandButtonProcessor, "IDC_BUT_ABOUT", ShowAbout, ()), ), "IDD_FILTER_NOW" : ( (CloseButtonProcessor, "IDOK IDCANCEL"), (BoolButtonProcessor, "IDC_BUT_UNREAD", "Filter_Now.only_unread"), (BoolButtonProcessor, "IDC_BUT_UNSEEN", "Filter_Now.only_unseen"), (BoolButtonProcessor, "IDC_BUT_ACT_ALL IDC_BUT_ACT_SCORE", "Filter_Now.action_all"), (FolderIDProcessor, "IDC_FOLDER_NAMES IDC_BROWSE", "Filter_Now.folder_ids", "Filter_Now.include_sub"), (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", filter.filterer, "Start Filtering", "Stop Filtering", "IDC_BUT_UNSEEN IDC_BUT_UNREAD IDC_BROWSE " \ "IDOK IDC_BUT_ACT_SCORE IDC_BUT_ACT_ALL"), ), "IDD_FILTER" : ( (CloseButtonProcessor, "IDOK IDCANCEL"), (FolderIDProcessor, "IDC_FOLDER_WATCH IDC_BROWSE_WATCH", "Filter.watch_folder_ids", "Filter.watch_include_sub"), (ComboProcessor, "IDC_ACTION_CERTAIN", "Filter.spam_action"), (FolderIDProcessor, "IDC_FOLDER_CERTAIN IDC_BROWSE_CERTAIN", "Filter.spam_folder_id"), (EditNumberProcessor, "IDC_EDIT_CERTAIN IDC_SLIDER_CERTAIN", "Filter.spam_threshold"), (FolderIDProcessor, "IDC_FOLDER_UNSURE IDC_BROWSE_UNSURE", "Filter.unsure_folder_id"), (EditNumberProcessor, "IDC_EDIT_UNSURE IDC_SLIDER_UNSURE", "Filter.unsure_threshold"), (ComboProcessor, "IDC_ACTION_UNSURE", "Filter.unsure_action"), (DialogCommand, "IDC_BUT_FILTER_NOW", "IDD_FILTER_NOW"), ), "IDD_TRAINING" : ( (CloseButtonProcessor, "IDOK IDCANCEL"), (FolderIDProcessor, "IDC_STATIC_HAM IDC_BROWSE_HAM", "Training.ham_folder_ids", "Training.ham_include_sub"), (FolderIDProcessor, "IDC_STATIC_SPAM IDC_BROWSE_SPAM", "Training.spam_folder_ids", "Training.spam_include_sub"), (BoolButtonProcessor, "IDC_BUT_RESCORE", "Training.rescore"), (BoolButtonProcessor, "IDC_BUT_REBUILD", "Training.rebuild"), (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", train.trainer, "Start Training", "Stop", "IDC_BROWSE_HAM IDC_BROWSE_SPAM " \ "IDC_BUT_REBUILD IDC_BUT_RESCORE"), ) } Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** __init__.py 19 Oct 2002 18:14:01 -0000 1.2 --- __init__.py 4 Aug 2003 07:21:15 -0000 1.2.4.1 *************** *** 1,2 **** --- 1,19 ---- # This package defines dialog boxes used by the main # SpamBayes Outlook 2k integration code. + + def LoadDialogs(rc_file = "dialogs.rc"): + import os + from resources import rcparser + if not os.path.isabs(rc_file): + rc_file = os.path.join( os.path.dirname( rcparser.__file__ ), rc_file) + return rcparser.ParseDialogs(rc_file) + + def ShowDialog(parent, manager, idd): + """Displays another dialog""" + if manager.dialog_parser is None: + manager.dialog_parser = LoadDialogs() + import dialog_map + commands = dialog_map.dialog_map[idd] + import dlgcore + dlg = dlgcore.Dialog(parent, manager, idd, commands) + dlg.DoModal() Index: test_dialogs.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/test_dialogs.py,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** test_dialogs.py 4 Aug 2003 06:55:19 -0000 1.1.2.6 --- test_dialogs.py 4 Aug 2003 07:21:15 -0000 1.1.2.7 *************** *** 1,4 **** ! # Hack for testing - setup sys.path if __name__=='__main__': try: import spambayes.Options --- 1,5 ---- ! # Test code for the SpamBayes dialogs. if __name__=='__main__': + # Hack for testing - setup sys.path try: import spambayes.Options *************** *** 7,214 **** sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", ".."))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))) - - from processors import * - from opt_processors import * - - # "dialog specific" processors: - class VersionStringProcessor(ControlProcessor): - def Init(self): - from spambayes.Version import get_version_string - import sys - version_key = "Full Description" - if hasattr(sys, "frozen"): - version_key += " Binary" - version_string = get_version_string("Outlook", version_key) - win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, - 0, version_string) - - def GetPopupHelpText(self, cid): - return "The version of SpamBayes running" - - class TrainingStatusProcessor(ControlProcessor): - def Init(self): - bayes = self.window.manager.bayes - 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" - win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, - 0, db_status) - - class FilterEnableProcessor(BoolButtonProcessor): - def UpdateValue_FromControl(self): - check = win32gui.SendMessage(self.GetControl(), win32con.BM_GETCHECK) - if check: - reason = self.window.manager.GetDisabledReason() - if reason is not None: - win32gui.SendMessage(self.GetControl(), win32con.BM_SETCHECK, 0) - raise ValueError, reason - check = not not check # force bool! - self.SetOptionValue(check) - class FilterStatusProcessor(ControlProcessor): - def OnOptionChanged(self, option): - self.Init() - - def Init(self): - manager = self.window.manager - reason = manager.GetDisabledReason() - if reason is not None: - win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, - 0, reason) - 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) - return - # ok, enabled and working - put together the status text. - config = manager.config.filter - certain_spam_name = manager.FormatFolderNames( - [config.spam_folder_id], False) - if config.unsure_folder_id: - unsure_name = manager.FormatFolderNames( - [config.unsure_folder_id], False) - unsure_text = "unsure managed in '%s'" % (unsure_name,) - else: - unsure_text = "unsure messages untouched" - - watch_names = manager.FormatFolderNames( - config.watch_folder_ids, config.watch_include_sub) - filter_status = "Watching '%s'. Spam managed in '%s', %s" \ - % (watch_names, - certain_spam_name, - unsure_text) - win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, - 0, filter_status) - - def ShowAbout(mgr): - """Displays the main SpamBayes documentation in your Web browser""" - import sys, os - if hasattr(sys, "frozen"): - # Same directory as to the executable. - fname = os.path.join(os.path.dirname(sys.argv[0]), - "about.html") - else: - # In the parent (ie, main Outlook2000) dir - fname = os.path.join(os.path.dirname(__file__), - os.pardir, - "about.html") - fname = os.path.abspath(fname) - if os.path.isfile(fname): - SetWaitCursor(1) - os.startfile(fname) - SetWaitCursor(0) - else: - print "Cant find about - fix messagebox" - self.MessageBox("Can't find about.html") - - class DialogCommand(ButtonProcessor): - def __init__(self, window, control_ids, idd): - self.idd = idd - ButtonProcessor.__init__(self, window, control_ids) - def OnClicked(self, id): - parent = self.window.hwnd - # Thos form and the other form may "share" options, or at least - # depend on others. So we must save the current form back to the - # options object, display the new dialog, then reload the current - # form from the options object/ - self.window.SaveAllControls() - ShowDialog(parent, self.window.manager, self.idd) - self.window.LoadAllControls() - - def GetPopupHelpText(self, id): - dd = self.window.manager.dialog_parser.dialogs[self.idd] - return "Displays the %s dialog" % dd.caption - - from async_processor import AsyncCommandProcessor - - import filter, train - - dialog_map = { - "IDD_MANAGER" : ( - (CloseButtonProcessor, "IDOK IDCANCEL"), - (VersionStringProcessor, "IDC_VERSION"), - (TrainingStatusProcessor, "IDC_TRAINING_STATUS"), - (FilterEnableProcessor, "IDC_BUT_FILTER_ENABLE", "Filter.enabled"), - (FilterStatusProcessor, "IDC_FILTER_STATUS"), - (BoolButtonProcessor, "IDC_BUT_TRAIN_FROM_SPAM_FOLDER", - "Training.train_recovered_spam"), - (BoolButtonProcessor, "IDC_BUT_TRAIN_TO_SPAM_FOLDER", - "Training.train_manual_spam"), - (DialogCommand, "IDC_BUT_FILTER_NOW", "IDD_FILTER_NOW"), - (DialogCommand, "IDC_BUT_FILTER_DEFINE", "IDD_FILTER"), - (DialogCommand, "IDC_BUT_TRAIN_NOW", "IDD_TRAINING"), - (CommandButtonProcessor, "IDC_BUT_ABOUT", ShowAbout, ()), - ), - "IDD_FILTER_NOW" : ( - (CloseButtonProcessor, "IDOK IDCANCEL"), - (BoolButtonProcessor, "IDC_BUT_UNREAD", "Filter_Now.only_unread"), - (BoolButtonProcessor, "IDC_BUT_UNSEEN", "Filter_Now.only_unseen"), - (BoolButtonProcessor, "IDC_BUT_ACT_ALL IDC_BUT_ACT_SCORE", - "Filter_Now.action_all"), - (FolderIDProcessor, "IDC_FOLDER_NAMES IDC_BROWSE", - "Filter_Now.folder_ids", - "Filter_Now.include_sub"), - (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", - filter.filterer, "Start Filtering", "Stop Filtering", - "IDC_BUT_UNSEEN IDC_BUT_UNREAD IDC_BROWSE " \ - "IDOK IDC_BUT_ACT_SCORE IDC_BUT_ACT_ALL"), - ), - "IDD_FILTER" : ( - (CloseButtonProcessor, "IDOK IDCANCEL"), - (FolderIDProcessor, "IDC_FOLDER_WATCH IDC_BROWSE_WATCH", - "Filter.watch_folder_ids", - "Filter.watch_include_sub"), - (ComboProcessor, "IDC_ACTION_CERTAIN", "Filter.spam_action"), - - (FolderIDProcessor, "IDC_FOLDER_CERTAIN IDC_BROWSE_CERTAIN", - "Filter.spam_folder_id"), - (EditNumberProcessor, "IDC_EDIT_CERTAIN IDC_SLIDER_CERTAIN", - "Filter.spam_threshold"), - - (FolderIDProcessor, "IDC_FOLDER_UNSURE IDC_BROWSE_UNSURE", - "Filter.unsure_folder_id"), - (EditNumberProcessor, "IDC_EDIT_UNSURE IDC_SLIDER_UNSURE", - "Filter.unsure_threshold"), - - (ComboProcessor, "IDC_ACTION_UNSURE", "Filter.unsure_action"), - (DialogCommand, "IDC_BUT_FILTER_NOW", "IDD_FILTER_NOW"), - ), - "IDD_TRAINING" : ( - (CloseButtonProcessor, "IDOK IDCANCEL"), - (FolderIDProcessor, "IDC_STATIC_HAM IDC_BROWSE_HAM", - "Training.ham_folder_ids", - "Training.ham_include_sub"), - (FolderIDProcessor, "IDC_STATIC_SPAM IDC_BROWSE_SPAM", - "Training.spam_folder_ids", - "Training.spam_include_sub"), - (BoolButtonProcessor, "IDC_BUT_RESCORE", "Training.rescore"), - (BoolButtonProcessor, "IDC_BUT_REBUILD", "Training.rebuild"), - (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", - train.trainer, "Start Training", "Stop", - "IDC_BROWSE_HAM IDC_BROWSE_SPAM " \ - "IDC_BUT_REBUILD IDC_BUT_RESCORE"), - ) - } - - def LoadDialogs(rc_file): - from dialogs.resources import rcparser - if not os.path.isabs(rc_file): - rc_file = os.path.join( os.path.dirname( rcparser.__file__ ), rc_file) - return rcparser.ParseDialogs(rc_file) - - def ShowDialog(parent, manager, idd): - """Displays another dialog""" - commands = dialog_map[idd] - import dlgcore - dlg = dlgcore.Dialog(parent, manager, idd, commands) - dlg.DoModal() - - if __name__=='__main__': import manager mgr = manager.GetManager() ! mgr.dialog_parser = LoadDialogs("dialogs.rc") ShowDialog(0, mgr, "IDD_MANAGER") --- 8,14 ---- sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..", ".."))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))) import manager mgr = manager.GetManager() ! from dialogs import ShowDialog ShowDialog(0, mgr, "IDD_MANAGER") --- AsyncDialog.py DELETED --- --- DialogGlobals.py DELETED --- --- FilterDialog.py DELETED --- --- ManagerDialog.py DELETED --- --- TrainingDialog.py DELETED --- From mhammond at users.sourceforge.net Mon Aug 4 01:38:56 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 03:39:00 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dlgcore.py, 1.1.2.4, 1.1.2.5 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv10533 Modified Files: Tag: outlook-dialog-branch dlgcore.py Log Message: Remove some print statements. Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/dlgcore.py,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** dlgcore.py 4 Aug 2003 05:29:23 -0000 1.1.2.4 --- dlgcore.py 4 Aug 2003 07:38:54 -0000 1.1.2.5 *************** *** 154,158 **** def OnDestroy(self, hwnd, msg, wparam, lparam): ! print "OnDestroy" self.command_processors = None self.all_processors = None --- 154,158 ---- def OnDestroy(self, hwnd, msg, wparam, lparam): ! #print "OnDestroy" self.command_processors = None self.all_processors = None *************** *** 160,164 **** def _DoSize(self, cx, cy, repaint = 1): ! print "resize" def OnLButtonDown(self, hwnd, msg, wparam, lparam): --- 160,164 ---- def _DoSize(self, cx, cy, repaint = 1): ! pass def OnLButtonDown(self, hwnd, msg, wparam, lparam): *************** *** 208,212 **** def OnClose(self, hwnd, msg, wparam, lparam): ! print "OnClose" if not self.SaveAllControls(): return 1 --- 208,212 ---- def OnClose(self, hwnd, msg, wparam, lparam): ! #print "OnClose" if not self.SaveAllControls(): return 1 From mhammond at users.sourceforge.net Mon Aug 4 01:39:15 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 03:39:19 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs __init__.py, 1.2.4.1, 1.2.4.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv10582 Modified Files: Tag: outlook-dialog-branch __init__.py Log Message: Make dialogs modal when shown in Outlook. Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** __init__.py 4 Aug 2003 07:21:15 -0000 1.2.4.1 --- __init__.py 4 Aug 2003 07:39:13 -0000 1.2.4.2 *************** *** 15,18 **** --- 15,25 ---- import dialog_map commands = dialog_map.dialog_map[idd] + if not parent: + import win32gui + try: + parent = win32gui.GetActiveWindow() + except win32gui.error: + pass + import dlgcore dlg = dlgcore.Dialog(parent, manager, idd, commands) From mhammond at users.sourceforge.net Mon Aug 4 01:51:16 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 03:51:19 2003 Subject: [Spambayes-checkins] website faq.txt,1.23,1.24 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv12230 Modified Files: faq.txt Log Message: Typos in the most recent FAQ entry I added. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** faq.txt 4 Aug 2003 00:52:46 -0000 1.23 --- faq.txt 4 Aug 2003 07:51:14 -0000 1.24 *************** *** 460,464 **** useful). The second common trick is by sending HTML spam that references unique URLs (generally images) on the spammer's server. ! When this HTML message is rendered, these fetching of these URLs identifies to the spammer the associated email address. --- 460,464 ---- useful). The second common trick is by sending HTML spam that references unique URLs (generally images) on the spammer's server. ! When this HTML message is rendered, the fetching of these URLs identifies to the spammer the associated email address. *************** *** 466,470 **** for "Show Spam Clues", even though the message is marked as read (and we don't know how to prevent it being marked as read). However ! that if you are concerned about this, you are encouraged to configure Outlook's generation of receipts manually. --- 466,470 ---- for "Show Spam Clues", even though the message is marked as read (and we don't know how to prevent it being marked as read). However ! if you are concerned about this, you are encouraged to configure Outlook's generation of receipts manually. From montanaro at users.sourceforge.net Mon Aug 4 09:06:11 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Mon Aug 4 11:06:19 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 about.html,1.17,1.18 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv16704 Modified Files: about.html Log Message: typo Index: about.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/about.html,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** about.html 31 Jul 2003 12:28:48 -0000 1.17 --- about.html 4 Aug 2003 15:06:08 -0000 1.18 *************** *** 123,127 **** troubleshooting guide.
  • Create Spam and Usure folders
    Use the normal Outlook functions to create two new folders.  These can be named anything you like, and can appear anywhere in the folder --- 123,127 ---- troubleshooting guide.
  • Create Spam and Unsure folders
    Use the normal Outlook functions to create two new folders.  These can be named anything you like, and can appear anywhere in the folder From mhammond at users.sourceforge.net Mon Aug 4 16:57:17 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 4 18:57:22 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rcparser.py, 1.1.2.2, 1.1.2.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv7690/resources Modified Files: Tag: outlook-dialog-branch rcparser.py Log Message: Close the file after parsing, and groupboxes are buttons, not static text (thanks to Kenny Pit for spotting this) Index: rcparser.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/rcparser.py,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** rcparser.py 4 Aug 2003 04:09:18 -0000 1.1.2.2 --- rcparser.py 4 Aug 2003 22:57:15 -0000 1.1.2.3 *************** *** 16,20 **** "CTEXT":0x82, "RTEXT":0x82, ! "GROUPBOX":0x82, "LTEXT":0x82, "LISTBOX":0x83, --- 16,20 ---- "CTEXT":0x82, "RTEXT":0x82, ! "GROUPBOX":0x80, "LTEXT":0x82, "LISTBOX":0x83, *************** *** 124,128 **** self.parse() self.getToken() ! #close(f) def open(self, file): self.lex = shlex.shlex(file) --- 124,128 ---- self.parse() self.getToken() ! f.close() def open(self, file): self.lex = shlex.shlex(file) From mhammond at users.sourceforge.net Tue Aug 5 02:16:18 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 5 04:16:23 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.h, 1.1.2.1, 1.1.2.2 dialogs.rc, 1.1.2.2, 1.1.2.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv23110 Modified Files: Tag: outlook-dialog-branch dialogs.h dialogs.rc Log Message: Add "Folder Selector" dialog, and re-save in AppStudio. Index: dialogs.h =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/dialogs.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** dialogs.h 4 Aug 2003 01:13:56 -0000 1.1.2.1 --- dialogs.h 5 Aug 2003 08:16:16 -0000 1.1.2.2 *************** *** 7,10 **** --- 7,11 ---- #define IDD_FILTER 103 #define IDD_FILTER_NOW 104 + #define IDD_FOLDER_SELECTOR 105 #define IDC_PROGRESS 1000 #define IDC_PROGRESS_TEXT 1001 *************** *** 47,50 **** --- 48,56 ---- #define IDC_FOLDER_WATCH 1038 #define IDC_BROWSE_WATCH 1039 + #define IDC_LIST_FOLDERS 1040 + #define IDC_BUT_SEARCHSUB 1041 + #define IDC_BUT_CLEARALL 1042 + #define IDC_STATUS1 1043 + #define IDC_STATUS2 1044 // Next default values for new objects *************** *** 52,58 **** #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 105 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1039 #define _APS_NEXT_SYMED_VALUE 101 #endif --- 58,64 ---- #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 106 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1045 #define _APS_NEXT_SYMED_VALUE 101 #endif Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/dialogs.rc,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** dialogs.rc 4 Aug 2003 06:54:34 -0000 1.1.2.2 --- dialogs.rc 5 Aug 2003 08:16:16 -0000 1.1.2.3 *************** *** 8,12 **** // Generated from the TEXTINCLUDE 2 resource. // ! #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// --- 8,13 ---- // Generated from the TEXTINCLUDE 2 resource. // ! #include "winres.h" ! // spambayes dialog definitions ///////////////////////////////////////////////////////////////////////////// *************** *** 31,35 **** EXSTYLE WS_EX_CONTEXTHELP CAPTION "SpamBayes" ! FONT 8, "MS Sans Serif" BEGIN CONTROL "SpamBayes version xxx",IDC_VERSION,"Static", --- 32,36 ---- EXSTYLE WS_EX_CONTEXTHELP CAPTION "SpamBayes" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN CONTROL "SpamBayes version xxx",IDC_VERSION,"Static", *************** *** 69,73 **** EXSTYLE WS_EX_CONTEXTHELP CAPTION "Training" ! FONT 8, "MS Sans Serif" BEGIN LTEXT "Folders with known good messages.",IDC_STATIC,7,6,131, --- 70,74 ---- EXSTYLE WS_EX_CONTEXTHELP CAPTION "Training" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Folders with known good messages.",IDC_STATIC,7,6,131, *************** *** 96,100 **** EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Now" ! FONT 8, "MS Sans Serif" BEGIN LTEXT "Filter the following folders",IDC_STATIC,8,9,168,11 --- 97,101 ---- EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Now" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Filter the following folders",IDC_STATIC,8,9,168,11 *************** *** 125,129 **** EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Rules" ! FONT 8, "MS Sans Serif" BEGIN LTEXT "Filter the following folders as messages arrive", --- 126,130 ---- EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Rules" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Filter the following folders as messages arrive", *************** *** 168,171 **** --- 169,191 ---- END + IDD_FOLDER_SELECTOR DIALOG DISCARDABLE 0, 0, 247, 215 + STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU + CAPTION "Dialog" + FONT 8, "MS Sans Serif" + BEGIN + LTEXT "&Folders:",IDC_STATIC,7,7,47,9 + CONTROL "",IDC_LIST_FOLDERS,"SysTreeView32",TVS_HASBUTTONS | + TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | + TVS_SHOWSELALWAYS | TVS_CHECKBOXES | WS_BORDER | + WS_TABSTOP,7,21,172,140 + CONTROL "(sub)",IDC_BUT_SEARCHSUB,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,167,126,9 + LTEXT "(status1)",IDC_STATUS1,7,180,220,9 + LTEXT "(status2)",IDC_STATUS2,7,194,220,9 + DEFPUSHBUTTON "OK",IDOK,190,21,50,14 + PUSHBUTTON "Cancel",IDCANCEL,190,39,50,14 + PUSHBUTTON "C&lear All",IDC_BUT_CLEARALL,190,58,50,14 + END + #ifdef APSTUDIO_INVOKED *************** *** 182,186 **** 2 TEXTINCLUDE DISCARDABLE BEGIN ! "// spambayes dialog definitions \r\n" "\0" END --- 202,207 ---- 2 TEXTINCLUDE DISCARDABLE BEGIN ! "#include ""winres.h""\r\n" ! "// spambayes dialog definitions\r\n" "\0" END From mhammond at users.sourceforge.net Tue Aug 5 02:17:21 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 5 04:17:25 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs __init__.py, 1.2.4.2, 1.2.4.3 dlgcore.py, 1.1.2.5, 1.1.2.6 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv23289 Modified Files: Tag: outlook-dialog-branch __init__.py dlgcore.py Log Message: Break the dialog into various classes, for better reuse. Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v retrieving revision 1.2.4.2 retrieving revision 1.2.4.3 diff -C2 -d -r1.2.4.2 -r1.2.4.3 *** __init__.py 4 Aug 2003 07:39:13 -0000 1.2.4.2 --- __init__.py 5 Aug 2003 08:17:19 -0000 1.2.4.3 *************** *** 23,26 **** import dlgcore ! dlg = dlgcore.Dialog(parent, manager, idd, commands) dlg.DoModal() --- 23,26 ---- import dlgcore ! dlg = dlgcore.ProcessorDialog(parent, manager, idd, commands) dlg.DoModal() Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/dlgcore.py,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** dlgcore.py 4 Aug 2003 07:38:54 -0000 1.1.2.5 --- dlgcore.py 5 Aug 2003 08:17:19 -0000 1.1.2.6 *************** *** 70,103 **** 1,data) class Dialog: ! def __init__(self, parent, manager, idd, option_handlers): ! parser = manager.dialog_parser self.parent = parent ! self.manager = manager ! self.tt = TooltipManager(self) self.dialog_def = parser.dialogs[idd] self.template = self.dialog_def.createDialogTemplate() - win32gui.InitCommonControls() - self.hinst = win32api.GetModuleHandle(None) - self.options = manager.options - self.command_processors = {} - self.processor_message_map = {} # WM_MESSAGE : [processors_who_want_it] - self.all_processors = [] - for data in option_handlers: - klass = data[0] - id_names = data[1] - rest = data[2:] - ids = id_names.split() - int_ids = [ parser.ids[id] for id in ids] - instance = klass(self,int_ids, *rest) - self.all_processors.append(instance) - for int_id in int_ids: - self.command_processors[int_id] = instance - for message in instance.GetMessages(): - existing = self.processor_message_map.setdefault(message, []) - existing.append(instance) def _GetIDName(self, cid): ! return self.manager.dialog_parser.names.get(cid, str(cid)) def CreateWindow(self): --- 70,85 ---- 1,data) + # A base dialog class, that loads from resources. Has no real smarts. class Dialog: ! def __init__(self, parent, parser, idd): ! win32gui.InitCommonControls() ! self.hinst = win32api.GetModuleHandle(None) self.parent = parent ! self.dialog_parser = parser self.dialog_def = parser.dialogs[idd] self.template = self.dialog_def.createDialogTemplate() def _GetIDName(self, cid): ! return self.dialog_parser.names.get(cid, str(cid)) def CreateWindow(self): *************** *** 107,121 **** return self._DoCreate(win32gui.DialogBoxIndirect) - def OnCommandProcessorMessage(self, hwnd, msg, wparam, lparam): - for p in self.processor_message_map[msg]: - p.OnMessage(msg, wparam, lparam) - - # Called back by a processor when it changes an option. We tell all other - # options on our page that the value changed. - def OnOptionChanged(self, changed_by, option): - for p in self.all_processors: - if p is not changed_by: - p.OnOptionChanged(option) - def GetMessageMap(self): ret = { --- 89,92 ---- *************** *** 125,147 **** win32con.WM_INITDIALOG: self.OnInitDialog, win32con.WM_CLOSE: self.OnClose, - win32con.WM_HELP: self.OnHelp, win32con.WM_DESTROY: self.OnDestroy, - win32con.WM_LBUTTONDOWN: self.OnLButtonDown, - win32con.WM_ACTIVATE: self.OnActivate, } - for key in self.processor_message_map.keys(): - if key in ret: - print "*** WARNING: Overwriting message!!!" - ret[key] = self.OnCommandProcessorMessage return ret - def _DoCreate(self, fn): - message_map = self.GetMessageMap() - return win32gui.DialogBoxIndirect(self.hinst, self.template, self.parent, message_map) - def OnInitDialog(self, hwnd, msg, wparam, lparam): self.hwnd = hwnd - self.LoadAllControls() - # centre the dialog desktop = win32gui.GetDesktopWindow() --- 96,105 ---- *************** *** 150,165 **** centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)/2, (dt_b-dt_t)/2) ) win32gui.MoveWindow(hwnd, centre_x-(r/2), centre_y-(b/2), r-l, b-t, 0) - l,t,r,b = win32gui.GetClientRect(self.hwnd) - self._DoSize(r-l,b-t, 1) def OnDestroy(self, hwnd, msg, wparam, lparam): - #print "OnDestroy" - self.command_processors = None - self.all_processors = None - self.processor_message_map = None - - def _DoSize(self, cx, cy, repaint = 1): pass def OnLButtonDown(self, hwnd, msg, wparam, lparam): self.tt.HideTooltip() --- 108,148 ---- centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)/2, (dt_b-dt_t)/2) ) win32gui.MoveWindow(hwnd, centre_x-(r/2), centre_y-(b/2), r-l, b-t, 0) + def OnCommand(self, hwnd, msg, wparam, lparam): + pass + def OnNotify(self, hwnd, msg, wparam, lparam): + pass + def OnClose(self, hwnd, msg, wparam, lparam): + pass def OnDestroy(self, hwnd, msg, wparam, lparam): pass + def _DoCreate(self, fn): + message_map = self.GetMessageMap() + return win32gui.DialogBoxIndirect(self.hinst, self.template, self.parent, message_map) + # A couple of helpers + def GetDlgItem(self, id): + if type(id)==type(''): + id = self.dialog_parser.ids[id] + return win32gui.GetDlgItem(self.hwnd, id) + def SetDlgItemText(self, id, text): + hchild = self.GetDlgItem(id) + win32gui.SendMessage(hchild, win32con.WM_SETTEXT, 0, text) + + # A dialog with a tooltip manager + class TooltipDialog(Dialog): + def __init__(self, parent, parser, idd): + Dialog.__init__(self, parent, parser, idd) + self.tt = TooltipManager(self) + + def GetMessageMap(self): + ret = Dialog.GetMessageMap(self) + ret.update( { + win32con.WM_HELP: self.OnHelp, + win32con.WM_LBUTTONDOWN: self.OnLButtonDown, + win32con.WM_ACTIVATE: self.OnActivate, + }) + return ret + def OnLButtonDown(self, hwnd, msg, wparam, lparam): self.tt.HideTooltip() *************** *** 174,183 **** struct.unpack(format, buf) #print "OnHelp", cbSize, iContextType, iCtrlId, hItemHandle, dwContextID, x, y ! cp = self.command_processors.get(iCtrlId) ! tt_text = None ! if cp is not None: ! tt_text = cp.GetPopupHelpText(iCtrlId) ! else: ! print "Can not get command processor for", self._GetIDName(iCtrlId) if tt_text: self.tt.ShowTooltipForControl(iCtrlId, tt_text) --- 157,161 ---- struct.unpack(format, buf) #print "OnHelp", cbSize, iContextType, iCtrlId, hItemHandle, dwContextID, x, y ! tt_text = self.GetPopupHelpText(iCtrlId) if tt_text: self.tt.ShowTooltipForControl(iCtrlId, tt_text) *************** *** 186,189 **** --- 164,234 ---- return 1 + def GetPopupHelpText(self, control_id): + return None + + # A "Processor Dialog" works with Command Processors, to link SpamBayes + # options with control IDS, giving a "data driven" dialog. + class ProcessorDialog(TooltipDialog): + def __init__(self, parent, manager, idd, option_handlers): + TooltipDialog.__init__(self, parent, manager.dialog_parser, idd) + parser = manager.dialog_parser + self.manager = manager + self.options = manager.options + self.command_processors = {} + self.processor_message_map = {} # WM_MESSAGE : [processors_who_want_it] + self.all_processors = [] + for data in option_handlers: + klass = data[0] + id_names = data[1] + rest = data[2:] + ids = id_names.split() + int_ids = [ parser.ids[id] for id in ids] + instance = klass(self,int_ids, *rest) + self.all_processors.append(instance) + for int_id in int_ids: + self.command_processors[int_id] = instance + for message in instance.GetMessages(): + existing = self.processor_message_map.setdefault(message, []) + existing.append(instance) + + def GetMessageMap(self): + ret = TooltipDialog.GetMessageMap(self) + for key in self.processor_message_map.keys(): + if key in ret: + print "*** WARNING: Overwriting message!!!" + ret[key] = self.OnCommandProcessorMessage + return ret + + def OnInitDialog(self, hwnd, msg, wparam, lparam): + TooltipDialog.OnInitDialog(self, hwnd, msg, wparam, lparam) + self.LoadAllControls() + + def GetPopupHelpText(self, iCtrlId): + cp = self.command_processors.get(iCtrlId) + tt_text = None + if cp is not None: + return cp.GetPopupHelpText(iCtrlId) + + print "Can not get command processor for", self._GetIDName(iCtrlId) + return None + + def OnCommandProcessorMessage(self, hwnd, msg, wparam, lparam): + for p in self.processor_message_map[msg]: + p.OnMessage(msg, wparam, lparam) + + # Called back by a processor when it changes an option. We tell all other + # options on our page that the value changed. + def OnOptionChanged(self, changed_by, option): + for p in self.all_processors: + if p is not changed_by: + p.OnOptionChanged(option) + + + def OnDestroy(self, hwnd, msg, wparam, lparam): + #print "OnDestroy" + self.command_processors = None + self.all_processors = None + self.processor_message_map = None + def LoadAllControls(self): for p in self.all_processors: *************** *** 208,211 **** --- 253,258 ---- def OnClose(self, hwnd, msg, wparam, lparam): + if TooltipDialog.OnClose(self, hwnd, msg, wparam, lparam): + return 1 #print "OnClose" if not self.SaveAllControls(): *************** *** 213,225 **** win32gui.EndDialog(hwnd, 0) - def OnSize(self, hwnd, msg, wparam, lparam): - x = win32api.LOWORD(lparam) - y = win32api.HIWORD(lparam) - self._DoSize(x,y) - return 1 - def OnNotify(self, hwnd, msg, wparam, lparam): #print "OnNotify", hwnd, msg, wparam, lparam # Parse the NMHDR format = "iii" buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) --- 260,267 ---- win32gui.EndDialog(hwnd, 0) def OnNotify(self, hwnd, msg, wparam, lparam): #print "OnNotify", hwnd, msg, wparam, lparam # Parse the NMHDR + TooltipDialog.OnNotify(self, hwnd, msg, wparam, lparam) format = "iii" buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) *************** *** 234,238 **** def OnCommand(self, hwnd, msg, wparam, lparam): ! self.tt.HideTooltip() id = win32api.LOWORD(wparam) handler = self.command_processors.get(id) --- 276,280 ---- def OnCommand(self, hwnd, msg, wparam, lparam): ! TooltipDialog.OnCommand(self, hwnd, msg, wparam, lparam) id = win32api.LOWORD(wparam) handler = self.command_processors.get(id) From mhammond at users.sourceforge.net Tue Aug 5 02:18:24 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 5 04:18:31 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs FolderSelector.py, 1.20, 1.20.2.1 opt_processors.py, 1.1.2.3, 1.1.2.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv23389 Modified Files: Tag: outlook-dialog-branch FolderSelector.py opt_processors.py Log Message: Folder dialog using the new world order. Only 1 MFC dependency remains. Index: FolderSelector.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -C2 -d -r1.20 -r1.20.2.1 *** FolderSelector.py 18 Jun 2003 13:29:46 -0000 1.20 --- FolderSelector.py 5 Aug 2003 08:18:21 -0000 1.20.2.1 *************** *** 1,11 **** from __future__ import generators - from pywin.mfc import dialog import win32con import commctrl - import win32ui import win32api ! from DialogGlobals import * try: --- 1,17 ---- from __future__ import generators import win32con import commctrl import win32api + import win32gui ! import struct, array ! ! import dlgutils ! ! def INDEXTOSTATEIMAGEMASK(i): # from new commctrl.h ! return i << 12 ! IIL_UNCHECKED = 1 ! IIL_CHECKED = 2 try: *************** *** 56,60 **** def _BuildFoldersMAPI(manager, folder_spec): # This is called dynamically as folders are expanded. ! win32ui.DoWaitCursor(1) folder = manager.message_store.GetFolder(folder_spec.folder_id).OpenEntry() # Get the hierarchy table for it. --- 62,66 ---- def _BuildFoldersMAPI(manager, folder_spec): # This is called dynamically as folders are expanded. ! dlgutils.SetWaitCursor(1) folder = manager.message_store.GetFolder(folder_spec.folder_id).OpenEntry() # Get the hierarchy table for it. *************** *** 94,98 **** print "** Unable to open child folder - ignoring" print details ! win32ui.DoWaitCursor(0) return children --- 100,104 ---- print "** Unable to open child folder - ignoring" print details ! dlgutils.SetWaitCursor(0) return children *************** *** 123,168 **** return root ######################################################################### ## The dialog itself ######################################################################### ! # IDs for controls we use. ! IDC_STATUS1 = win32ui.IDC_PROMPT1 ! IDC_STATUS2 = win32ui.IDC_PROMPT2 ! IDC_BUTTON_SEARCHSUB = win32ui.IDC_BUTTON1 ! IDC_BUTTON_CLEARALL = win32ui.IDC_BUTTON2 ! IDC_LIST_FOLDERS = win32ui.IDC_LIST1 ! ! class FolderSelector(dialog.Dialog): ! style = (win32con.DS_MODALFRAME | ! win32con.WS_POPUP | ! win32con.WS_VISIBLE | ! win32con.WS_CAPTION | ! win32con.WS_SYSMENU | ! win32con.DS_SETFONT) ! cs = win32con.WS_CHILD | win32con.WS_VISIBLE ! treestyle = (cs | ! win32con.WS_BORDER | ! commctrl.TVS_HASLINES | ! commctrl.TVS_LINESATROOT | ! commctrl.TVS_CHECKBOXES | ! commctrl.TVS_HASBUTTONS | ! commctrl.TVS_DISABLEDRAGDROP | ! commctrl.TVS_SHOWSELALWAYS) ! dt = [ ! # Dialog itself. ! ["", (0, 0, 247, 215), style, None, (8, "MS Sans Serif")], ! # Children ! [STATIC, "&Folders:", -1, (7, 7, 47, 9), cs ], ! ["SysTreeView32", None, IDC_LIST_FOLDERS, (7, 21, 172, 140), treestyle | win32con.WS_TABSTOP], ! [BUTTON, '', IDC_BUTTON_SEARCHSUB, (7, 167, 126, 9), cs | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ! [STATIC, "", IDC_STATUS1, (7, 180, 220, 9), cs ], ! [STATIC, "", IDC_STATUS2, (7, 194, 220, 9), cs ], ! [BUTTON, 'OK', win32con.IDOK, (190, 21, 50, 14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP], ! [BUTTON, 'Cancel', win32con.IDCANCEL, (190, 39, 50, 14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP], ! [BUTTON, 'C&lear All', IDC_BUTTON_CLEARALL, (190, 58, 50, 14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP], ! ] ! ! def __init__ (self, manager, selected_ids=None, single_select=False, checkbox_state=False, --- 129,204 ---- return root + # Helpers for the ugly win32 structure packing/unpacking + def _GetMaskAndVal(val, default, mask, flag): + if val is None: + return mask, default + else: + mask |= flag + return mask, val + + def PackTVINSERTSTRUCT(parent, insertAfter, tvitem): + tvitem_buf, extra = PackTVITEM(*tvitem) + tvitem_buf = tvitem_buf.tostring() + format = "ii%ds" % len(tvitem_buf) + return struct.pack(format, parent, insertAfter, tvitem_buf), extra + + def PackTVITEM(hitem, state, stateMask, text, image, selimage, citems, param): + extra = [] # objects we must keep references to + mask = 0 + mask, hitem = _GetMaskAndVal(hitem, 0, mask, commctrl.TVIF_HANDLE) + mask, state = _GetMaskAndVal(state, 0, mask, commctrl.TVIF_STATE) + if not mask & commctrl.TVIF_STATE: + stateMask = 0 + mask, text = _GetMaskAndVal(text, None, mask, commctrl.TVIF_TEXT) + mask, image = _GetMaskAndVal(image, 0, mask, commctrl.TVIF_IMAGE) + mask, selimage = _GetMaskAndVal(selimage, 0, mask, commctrl.TVIF_SELECTEDIMAGE) + mask, citems = _GetMaskAndVal(citems, 0, mask, commctrl.TVIF_CHILDREN) + mask, param = _GetMaskAndVal(param, 0, mask, commctrl.TVIF_PARAM) + if text is None: + text_addr = text_len = 0 + else: + text_buffer = array.array("c", text+"\0") + extra.append(text_buffer) + text_addr, text_len = text_buffer.buffer_info() + format = "iiiiiiiiii" + buf = struct.pack(format, + mask, hitem, + state, stateMask, + text_addr, text_len, # text + image, selimage, + citems, param) + return array.array("c", buf), extra + + def UnpackLVITEM(buffer): + item_mask, item_hItem, item_state, item_stateMask, \ + item_textptr, item_cchText, item_image, item_selimage, \ + item_cChildren, item_param = struct.unpack("10i", buffer) + + if item_textptr: + text = win32gui.PyGetString(item_textptr) + else: + text = None + # Todo - translate items without the mask bit set to None + return item_hItem, item_state, item_stateMask, \ + text, item_image, item_selimage, \ + item_cChildren, item_param + + def UnpackLVNOTIFY(lparam): + format = "iiii40s40s" + buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) + hwndFrom, id, code, action, buf_old, buf_new \ + = struct.unpack(format, buf) + item_old = UnpackLVITEM(buf_old) + item_new = UnpackLVITEM(buf_new) + return hwndFrom, id, code, action, item_old, item_new + ######################################################################### ## The dialog itself ######################################################################### + import dlgcore ! FolderSelector_Parent = dlgcore.TooltipDialog ! class FolderSelector(FolderSelector_Parent): ! def __init__ (self, parent, manager, selected_ids=None, single_select=False, checkbox_state=False, *************** *** 174,182 **** PR_IPM_OUTBOX_ENTRYID) ): assert not single_select or selected_ids is None or len(selected_ids)<=1 - dialog.Dialog.__init__ (self, self.dt) self.single_select = single_select self.next_item_id = 1 self.item_map = {} self.select_desc_noun = desc_noun --- 210,219 ---- PR_IPM_OUTBOX_ENTRYID) ): + FolderSelector_Parent.__init__(self, parent, manager.dialog_parser, "IDD_FOLDER_SELECTOR") assert not single_select or selected_ids is None or len(selected_ids)<=1 self.single_select = single_select self.next_item_id = 1 self.item_map = {} + self.timer_id = None self.select_desc_noun = desc_noun *************** *** 227,231 **** mask = commctrl.TVIS_STATEIMAGEMASK item_id = self._MakeItemParam(child) ! hitem = self.list.InsertItem(hParent, 0, (None, state, --- 264,268 ---- mask = commctrl.TVIS_STATEIMAGEMASK item_id = self._MakeItemParam(child) ! insert_buf, extras = PackTVINSERTSTRUCT(hParent, 0, (None, state, *************** *** 236,243 **** cItems, item_id)) # If this folder is in the list of ones we need to expand # to show pre-selected items, then force expand now. if self.InIDs(child.folder_id, self.expand_ids): ! self.list.Expand(hitem, commctrl.TVE_EXPAND) # If single-select, and this is ours, select it # (multi-select uses check-boxes, not selection) --- 273,285 ---- cItems, item_id)) + hitem = win32gui.SendMessage(self.list, commctrl.TVM_INSERTITEM, + 0, insert_buf) + # If this folder is in the list of ones we need to expand # to show pre-selected items, then force expand now. if self.InIDs(child.folder_id, self.expand_ids): ! win32gui.SendMessage(self.list, ! commctrl.TVM_EXPAND, ! commctrl.TVE_EXPAND, hitem) # If single-select, and this is ours, select it # (multi-select uses check-boxes, not selection) *************** *** 245,249 **** self.selected_ids and self.InIDs(child.folder_id, self.selected_ids)): ! self.list.SelectItem(hitem) def _DetermineFoldersToExpand(self): --- 287,293 ---- self.selected_ids and self.InIDs(child.folder_id, self.selected_ids)): ! win32gui.SendMessage(self.list, ! commctrl.TVM_SELECTITEM, ! commctrl.TVGN_CARET, hitem) def _DetermineFoldersToExpand(self): *************** *** 259,270 **** return folders_to_expand def _YieldChildren(self, h): try: ! h = self.list.GetNextItem(h, commctrl.TVGN_CHILD) ! except win32ui.error: ! h = None ! while h is not None: ! info = self.list.GetItem(h) ! spec = self.item_map[info[7]] yield info, spec # Check children --- 303,324 ---- return folders_to_expand + def _GetLVItem(self, h): + text_buffer = "\0" * 1024 + buffer, extra = PackTVITEM(h, 0, 0, text_buffer, None, None, None, -1) + win32gui.SendMessage(self.list, commctrl.TVM_GETITEM, + 0, buffer.buffer_info()[0]) + return UnpackLVITEM(buffer.tostring()) + def _YieldChildren(self, h): try: ! h = win32gui.SendMessage(self.list, commctrl.TVM_GETNEXTITEM, ! commctrl.TVGN_CHILD, h) ! except win32gui.error: ! h = 0 ! while h: ! info = self._GetLVItem(h) ! item_param = info[-1] ! spec = self.item_map[item_param] ! yield info, spec # Check children *************** *** 272,277 **** yield info, spec try: ! h = self.list.GetNextItem(h, commctrl.TVGN_NEXT) ! except win32ui.error: h = None --- 326,332 ---- yield info, spec try: ! h = win32gui.SendMessage(self.list, commctrl.TVM_GETNEXTITEM, ! commctrl.TVGN_NEXT, h) ! except win32gui.error: h = None *************** *** 284,291 **** # selected state. try: ! h = self.list.GetSelectedItem() ! except win32ui.error: return ! info = self.list.GetItem(h) spec = self.item_map[info[7]] yield info, spec --- 339,347 ---- # selected state. try: ! h = win32gui.SendMessage(self.list, commctrl.TVM_GETSELECTEDITEM, ! commctrl.TVGN_CARET, h) ! except win32gui.error: return ! info = self._GetLVItem(h) spec = self.item_map[info[7]] yield info, spec *************** *** 297,337 **** yield info, spec ! def OnInitDialog (self): caption = "%s folder" % (self.select_desc_noun,) if not self.single_select: caption += "(s)" ! self.SetWindowText(caption) ! self.SetDlgItemText(IDC_BUTTON_SEARCHSUB, self.checkbox_text) if self.checkbox_state is None: ! self.GetDlgItem(IDC_BUTTON_SEARCHSUB).ShowWindow(win32con.SW_HIDE) else: ! self.GetDlgItem(IDC_BUTTON_SEARCHSUB).SetCheck(self.checkbox_state) ! self.list = self.GetDlgItem(win32ui.IDC_LIST1) ! ! self.HookNotify(self.OnTreeItemExpanding, commctrl.TVN_ITEMEXPANDING) ! self.HookNotify(self.OnTreeItemSelChanged, commctrl.TVN_SELCHANGED) ! self.HookNotify(self.OnTreeItemClick, commctrl.NM_CLICK) ! self.HookNotify(self.OnTreeItemDoubleClick, commctrl.NM_DBLCLK) ! self.HookCommand(self.OnClearAll, IDC_BUTTON_CLEARALL) bitmapID = win32ui.IDB_HIERFOLDERS bitmapMask = win32api.RGB(0,0,255) self.imageList = win32ui.CreateImageList(bitmapID, 16, 0, bitmapMask) ! self.list.SetImageList(self.imageList, commctrl.LVSIL_NORMAL) if self.single_select: # Remove the checkbox style from the list for single-selection ! style = win32api.GetWindowLong(self.list.GetSafeHwnd(), win32con.GWL_STYLE) style = style & ~commctrl.TVS_CHECKBOXES ! win32api.SetWindowLong(self.list.GetSafeHwnd(), win32con.GWL_STYLE, style) # Hide "clear all" ! self.GetDlgItem(IDC_BUTTON_CLEARALL).ShowWindow(win32con.SW_HIDE) # Extended MAPI version of the tree. # Build list of all ids to expand - ie, list includes all # selected folders, and all parents. ! win32ui.DoWaitCursor(1) self.expand_ids = self._DetermineFoldersToExpand() tree = BuildFolderTreeMAPI(self.manager.message_store.session, self.exclude_prop_ids) --- 353,409 ---- yield info, spec ! def GetSelectedIDs(self): ! try: ! self.GetDlgItem("IDC_LIST_FOLDERS") ! except win32gui.error: # dialog dead! ! return self.selected_ids, self.checkbox_state ! ret = [] ! for info, spec in self._YieldCheckedChildren(): ! ret.append(spec.folder_id) ! check = win32gui.SendMessage(self.GetDlgItem("IDC_BUT_SEARCHSUB"), ! win32con.BM_GETCHECK, 0, 0) ! return ret, check != 0 ! ! # Message processing ! # def GetMessageMap(self): ! ! def OnInitDialog (self, hwnd, msg, wparam, lparam): ! FolderSelector_Parent.OnInitDialog(self, hwnd, msg, wparam, lparam) caption = "%s folder" % (self.select_desc_noun,) if not self.single_select: caption += "(s)" ! win32gui.SendMessage(hwnd, win32con.WM_SETTEXT, 0, caption) ! self.SetDlgItemText("IDC_BUT_SEARCHSUB", self.checkbox_text) ! child = self.GetDlgItem("IDC_BUT_SEARCHSUB") if self.checkbox_state is None: ! win32gui.ShowWindow(child, win32con.SW_HIDE) else: ! win32gui.SendMessage(child, win32con.BM_SETCHECK, self.checkbox_state) ! self.list = self.GetDlgItem("IDC_LIST_FOLDERS") + print "Drop win32ui!!!!!" + import win32ui bitmapID = win32ui.IDB_HIERFOLDERS bitmapMask = win32api.RGB(0,0,255) self.imageList = win32ui.CreateImageList(bitmapID, 16, 0, bitmapMask) ! win32gui.SendMessage( self.list, ! commctrl.TVM_SETIMAGELIST, ! commctrl.TVSIL_NORMAL, self.imageList.GetSafeHandle() ) if self.single_select: # Remove the checkbox style from the list for single-selection ! style = win32api.GetWindowLong(self.list, win32con.GWL_STYLE) style = style & ~commctrl.TVS_CHECKBOXES ! win32api.SetWindowLong(self.list, win32con.GWL_STYLE, style) # Hide "clear all" ! child = self.GetDlgItem("IDC_BUT_CLEARALL") ! win32gui.ShowWindow(child, win32con.SW_HIDE) # Extended MAPI version of the tree. # Build list of all ids to expand - ie, list includes all # selected folders, and all parents. ! dlgutils.SetWaitCursor(1) self.expand_ids = self._DetermineFoldersToExpand() tree = BuildFolderTreeMAPI(self.manager.message_store.session, self.exclude_prop_ids) *************** *** 340,358 **** self.expand_ids = [] # Only use this while creating dialog. self._UpdateStatus() ! win32ui.DoWaitCursor(0) - return dialog.Dialog.OnInitDialog (self) ! def OnDestroy(self, msg): self.item_map = None ! return dialog.Dialog.OnDestroy(self, msg) ! def OnClearAll(self, id, code): if code == win32con.BN_CLICKED: ! for info, spec in self._YieldCheckedChildren(): ! state = INDEXTOSTATEIMAGEMASK(IIL_UNCHECKED) ! mask = commctrl.TVIS_STATEIMAGEMASK ! self.list.SetItemState(info[0], state, mask) ! self._UpdateStatus() def _DoUpdateStatus(self, id, timeval): --- 412,448 ---- self.expand_ids = [] # Only use this while creating dialog. self._UpdateStatus() ! dlgutils.SetWaitCursor(0) ! def OnDestroy(self, hwnd, msg, wparam, lparam): ! import timer ! if self.timer_id is not None: ! timer.kill_timer(self.timer_id) self.item_map = None ! FolderSelector_Parent.OnDestroy(self, hwnd, msg, wparam, lparam) ! def OnCommand(self, hwnd, msg, wparam, lparam): ! FolderSelector_Parent.OnCommand(self, hwnd, msg, wparam, lparam) ! id = win32api.LOWORD(wparam) ! id_name = self._GetIDName(id) ! code = win32api.HIWORD(wparam) ! if code == win32con.BN_CLICKED: ! # Button clicks ! if id == win32con.IDOK: ! self.selected_ids, self.checkbox_state = self.GetSelectedIDs() ! win32gui.EndDialog(hwnd, id) ! elif id == win32con.IDCANCEL: ! win32gui.EndDialog(hwnd, id) ! elif id_name == "IDC_BUT_CLEARALL": ! for info, spec in self._YieldCheckedChildren(): ! state = INDEXTOSTATEIMAGEMASK(IIL_UNCHECKED) ! mask = commctrl.TVIS_STATEIMAGEMASK ! buf, extra = PackTVITEM(info[0], state, mask, ! None, None, None, None, None) ! win32gui.SendMessage(self.list, commctrl.TVM_SETITEM, ! 0, buf) ! ! self._UpdateStatus() def _DoUpdateStatus(self, id, timeval): *************** *** 370,428 **** if num_checked != 1: status_string += "s" ! self.SetDlgItemText(IDC_STATUS1, status_string) ! self.SetDlgItemText(IDC_STATUS2, "; ".join(names)) finally: import timer timer.kill_timer(id) def _UpdateStatus(self): import timer ! timer.set_timer (0, self._DoUpdateStatus) ! ! def OnOK(self): ! self.selected_ids, self.checkbox_state = self.GetSelectedIDs() ! return self._obj_.OnOK() ! def OnCancel(self): ! return self._obj_.OnCancel() ! ! def OnTreeItemDoubleClick(self,(hwndFrom, idFrom, code), extra): ! if idFrom != IDC_LIST_FOLDERS: return None ! if self.single_select: # Only close on double-click for single-select ! self.OnOK() ! return 0 ! ! def OnTreeItemClick(self,(hwndFrom, idFrom, code), extra): ! if idFrom != IDC_LIST_FOLDERS: return None ! self._UpdateStatus() ! return 0 ! ! def OnTreeItemExpanding(self,(hwndFrom, idFrom, code), extra): ! if idFrom != IDC_LIST_FOLDERS: return None ! action, itemOld, itemNew, pt = extra ! if action == 1: return 0 # contracting, not expanding ! ! itemHandle = itemNew[0] ! info = self.list.GetItem(itemHandle) ! folderSpec = self.item_map[info[7]] ! if folderSpec.children is None: ! folderSpec.children = _BuildFoldersMAPI(self.manager, folderSpec) ! self._InsertSubFolders(itemHandle, folderSpec) ! return 0 ! ! def OnTreeItemSelChanged(self,(hwndFrom, idFrom, code), extra): ! if idFrom != IDC_LIST_FOLDERS: return None ! action, itemOld, itemNew, pt = extra ! self._UpdateStatus() ! return 1 ! def GetSelectedIDs(self): ! try: ! self.GetDlgItem(IDC_LIST_FOLDERS) ! except win32ui.error: # dialog dead! ! return self.selected_ids, self.checkbox_state ! ret = [] ! for info, spec in self._YieldCheckedChildren(): ! ret.append(spec.folder_id) ! return ret, self.GetDlgItem(IDC_BUTTON_SEARCHSUB).GetCheck() != 0 def Test(): --- 460,501 ---- if num_checked != 1: status_string += "s" ! self.SetDlgItemText("IDC_STATUS1", status_string) ! self.SetDlgItemText("IDC_STATUS2", "; ".join(names)) finally: import timer + self.timer_id = None timer.kill_timer(id) def _UpdateStatus(self): import timer ! if self.timer_id is not None: ! timer.kill_timer(self.timer_id) ! self.timer_id = timer.set_timer (0, self._DoUpdateStatus) ! def OnNotify(self, msg, hwnd, wparam, lparam): ! FolderSelector_Parent.OnNotify(self, hwnd, msg, wparam, lparam) ! format = "iii" ! buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) ! hwndFrom, id, code = struct.unpack(format, buf) ! code += 0x4f0000 # hrm - wtf - commctrl uses this, and it works with mfc. *sigh* ! id_name = self._GetIDName(id) ! if id_name == "IDC_LIST_FOLDERS": ! if code == commctrl.NM_CLICK: ! self._UpdateStatus() ! elif code == commctrl.NM_DBLCLK: ! if self.single_select: # Only close on double-click for single-select ! self.OnOK() ! elif code == commctrl.TVN_ITEMEXPANDING: ! ignore, ignore, ignore, action, itemOld, itemNew = \ ! UnpackLVNOTIFY(lparam) ! if action == 1: return 0 # contracting, not expanding ! itemHandle = itemNew[0] ! info = itemNew ! folderSpec = self.item_map[info[7]] ! if folderSpec.children is None: ! folderSpec.children = _BuildFoldersMAPI(self.manager, folderSpec) ! self._InsertSubFolders(itemHandle, folderSpec) ! elif code == commctrl.TVN_SELCHANGED: ! self._UpdateStatus() def Test(): *************** *** 430,438 **** sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))) import manager ids = [] ! d=FolderSelector(manager.GetManager(), ids, single_select = False) ! d.DoModal() ids, include_sub = d.GetSelectedIDs() ! d=FolderSelector(manager.GetManager(), ids, single_select = False) d.DoModal() --- 503,518 ---- sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))) import manager + mgr = manager.GetManager() + if mgr.dialog_parser is None: + import dialogs + mgr.dialog_parser = dialogs.LoadDialogs() + ids = [] ! d=FolderSelector(0, mgr, ids, single_select = False) ! if d.DoModal() != win32con.IDOK: ! print "Cancelled" ! return ids, include_sub = d.GetSelectedIDs() ! d=FolderSelector(0, mgr, ids, single_select = False, checkbox_state = include_sub) d.DoModal() Index: opt_processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/opt_processors.py,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** opt_processors.py 4 Aug 2003 05:29:23 -0000 1.1.2.3 --- opt_processors.py 5 Aug 2003 08:18:22 -0000 1.1.2.4 *************** *** 193,197 **** else: cb_state = None # don't show it. ! d = FolderSelector.FolderSelector(mgr, ids, single_select=not is_multi, --- 193,198 ---- else: cb_state = None # don't show it. ! d = FolderSelector.FolderSelector(self.window.hwnd, ! mgr, ids, single_select=not is_multi, From mhammond at users.sourceforge.net Tue Aug 5 04:58:42 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 5 06:58:46 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs FolderSelector.py, 1.20.2.1, 1.20.2.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv16345 Modified Files: Tag: outlook-dialog-branch FolderSelector.py Log Message: Bye bye win32ui. Index: FolderSelector.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v retrieving revision 1.20.2.1 retrieving revision 1.20.2.2 diff -C2 -d -r1.20.2.1 -r1.20.2.2 *** FolderSelector.py 5 Aug 2003 08:18:21 -0000 1.20.2.1 --- FolderSelector.py 5 Aug 2003 10:58:39 -0000 1.20.2.2 *************** *** 1,4 **** --- 1,5 ---- from __future__ import generators + import sys, os import win32con import commctrl *************** *** 216,219 **** --- 217,221 ---- self.item_map = {} self.timer_id = None + self.imageList = None self.select_desc_noun = desc_noun *************** *** 382,393 **** self.list = self.GetDlgItem("IDC_LIST_FOLDERS") ! print "Drop win32ui!!!!!" ! import win32ui ! bitmapID = win32ui.IDB_HIERFOLDERS bitmapMask = win32api.RGB(0,0,255) ! self.imageList = win32ui.CreateImageList(bitmapID, 16, 0, bitmapMask) win32gui.SendMessage( self.list, ! commctrl.TVM_SETIMAGELIST, ! commctrl.TVSIL_NORMAL, self.imageList.GetSafeHandle() ) if self.single_select: # Remove the checkbox style from the list for single-selection --- 384,397 ---- self.list = self.GetDlgItem("IDC_LIST_FOLDERS") ! fname = os.path.join(os.path.dirname(__file__), "resources/folders.bmp") bitmapMask = win32api.RGB(0,0,255) ! self.imageList = win32gui.ImageList_LoadImage(0, fname, ! 16, 0, ! bitmapMask, ! win32con.IMAGE_BITMAP, ! win32con.LR_LOADFROMFILE) win32gui.SendMessage( self.list, ! commctrl.TVM_SETIMAGELIST, ! commctrl.TVSIL_NORMAL, self.imageList ) if self.single_select: # Remove the checkbox style from the list for single-selection *************** *** 420,423 **** --- 424,428 ---- timer.kill_timer(self.timer_id) self.item_map = None + win32gui.ImageList_Destroy(self.imageList) FolderSelector_Parent.OnDestroy(self, hwnd, msg, wparam, lparam) From mhammond at users.sourceforge.net Tue Aug 5 04:59:37 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 5 06:59:41 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources folders.bmp, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv16674 Added Files: Tag: outlook-dialog-branch folders.bmp Log Message: Resources for the folder dialog. --- NEW FILE: folders.bmp --- (This appears to be a binary file; contents omitted.) From mhammond at users.sourceforge.net Tue Aug 5 06:06:03 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 5 08:06:05 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dlgcore.py, 1.1.2.6, 1.1.2.7 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv27216 Modified Files: Tag: outlook-dialog-branch dlgcore.py Log Message: Fix dialog centering. Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/dlgcore.py,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** dlgcore.py 5 Aug 2003 08:17:19 -0000 1.1.2.6 --- dlgcore.py 5 Aug 2003 12:06:00 -0000 1.1.2.7 *************** *** 105,111 **** desktop = win32gui.GetDesktopWindow() l,t,r,b = win32gui.GetWindowRect(self.hwnd) dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop) centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)/2, (dt_b-dt_t)/2) ) ! win32gui.MoveWindow(hwnd, centre_x-(r/2), centre_y-(b/2), r-l, b-t, 0) def OnCommand(self, hwnd, msg, wparam, lparam): --- 105,113 ---- desktop = win32gui.GetDesktopWindow() l,t,r,b = win32gui.GetWindowRect(self.hwnd) + w = r-l + h = b-t dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop) centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)/2, (dt_b-dt_t)/2) ) ! win32gui.MoveWindow(hwnd, centre_x-(w/2), centre_y-(h/2), w, h, 0) def OnCommand(self, hwnd, msg, wparam, lparam): From xenogeist at users.sourceforge.net Tue Aug 5 11:36:54 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Tue Aug 5 13:37:00 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rcparser.py, 1.1.2.3, 1.1.2.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv23558/Outlook2000/dialogs/resources Modified Files: Tag: outlook-dialog-branch rcparser.py Log Message: Move GROUPBOX to keep it grouped with other buttons. Index: rcparser.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/rcparser.py,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** rcparser.py 4 Aug 2003 22:57:15 -0000 1.1.2.3 --- rcparser.py 5 Aug 2003 17:36:52 -0000 1.1.2.4 *************** *** 13,20 **** "PUSHBUTTON":0x80, "Button":0x80, "Static":0x82, "CTEXT":0x82, "RTEXT":0x82, - "GROUPBOX":0x80, "LTEXT":0x82, "LISTBOX":0x83, --- 13,20 ---- "PUSHBUTTON":0x80, "Button":0x80, + "GROUPBOX":0x80, "Static":0x82, "CTEXT":0x82, "RTEXT":0x82, "LTEXT":0x82, "LISTBOX":0x83, From xenogeist at users.sourceforge.net Tue Aug 5 15:57:27 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Tue Aug 5 17:57:31 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/images .cvsignore, NONE, 1.1.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/images In directory sc8-pr-cvs1:/tmp/cvs-serv5314/Outlook2000/images Added Files: Tag: outlook-dialog-branch .cvsignore Log Message: ignore windows xp created Thumbs.db --- NEW FILE: .cvsignore --- Thumbs.db From xenogeist at users.sourceforge.net Tue Aug 5 16:57:38 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Tue Aug 5 18:57:41 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs __init__.py, 1.2.4.3, 1.2.4.4 dialog_map.py, 1.1.2.1, 1.1.2.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv14818/Outlook2000/dialogs Modified Files: Tag: outlook-dialog-branch __init__.py dialog_map.py Log Message: Put the about and troubleshooting html files on the toolbar menu. Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v retrieving revision 1.2.4.3 retrieving revision 1.2.4.4 diff -C2 -d -r1.2.4.3 -r1.2.4.4 *** __init__.py 5 Aug 2003 08:17:19 -0000 1.2.4.3 --- __init__.py 5 Aug 2003 22:57:35 -0000 1.2.4.4 *************** *** 25,26 **** --- 25,29 ---- dlg = dlgcore.ProcessorDialog(parent, manager, idd, commands) dlg.DoModal() + + import dlgutils + SetWaitCursor = dlgutils.SetWaitCursor Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/dialog_map.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** dialog_map.py 4 Aug 2003 07:21:15 -0000 1.1.2.1 --- dialog_map.py 5 Aug 2003 22:57:35 -0000 1.1.2.2 *************** *** 81,105 **** win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, filter_status) - def ShowAbout(mgr): ! """Displays the main SpamBayes documentation in your Web browser""" ! import sys, os ! if hasattr(sys, "frozen"): ! # Same directory as to the executable. ! fname = os.path.join(os.path.dirname(sys.argv[0]), ! "about.html") ! else: ! # In the parent (ie, main Outlook2000) dir ! fname = os.path.join(os.path.dirname(__file__), ! os.pardir, ! "about.html") ! fname = os.path.abspath(fname) ! if os.path.isfile(fname): ! SetWaitCursor(1) ! os.startfile(fname) ! SetWaitCursor(0) ! else: ! print "Cant find about - fix messagebox" ! self.MessageBox("Can't find about.html") class DialogCommand(ButtonProcessor): --- 81,86 ---- win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, filter_status) def ShowAbout(mgr): ! mgr.ShowHtml("about.html") class DialogCommand(ButtonProcessor): From xenogeist at users.sourceforge.net Tue Aug 5 16:57:37 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Tue Aug 5 18:57:44 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.86, 1.86.2.1 manager.py, 1.69.2.2, 1.69.2.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv14818/Outlook2000 Modified Files: Tag: outlook-dialog-branch addin.py manager.py Log Message: Put the about and troubleshooting html files on the toolbar menu. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.86 retrieving revision 1.86.2.1 diff -C2 -d -r1.86 -r1.86.2.1 *** addin.py 4 Aug 2003 00:56:07 -0000 1.86 --- addin.py 5 Aug 2003 22:57:35 -0000 1.86.2.1 *************** *** 412,415 **** --- 412,421 ---- self.manager.SaveBayesPostIncrementalTrain() + def ShowAbout(mgr): + mgr.ShowHtml("about.html") + + def ShowTroubleshooting(mgr): + mgr.ShowHtml("docs/troubleshooting.html") + # Event function fired from the "Show Clues" UI items. def ShowClues(mgr, explorer): *************** *** 778,781 **** --- 784,801 ---- Visible=True, Tag = "SpamBayesCommand.CheckVersion") + self._AddControl(popup, + constants.msoControlButton, + ButtonEvent, (ShowAbout, self.manager,), + Caption="About SpamBayes", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.ShowAbout") + self._AddControl(popup, + constants.msoControlButton, + ButtonEvent, (ShowTroubleshooting, self.manager,), + Caption="Troubleshooting Guide", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.ShowTroubleshooting") # If we are running from Python sources, enable a few extra items if not hasattr(sys, "frozen"): Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.69.2.2 retrieving revision 1.69.2.3 diff -C2 -d -r1.69.2.2 -r1.69.2.3 *** manager.py 4 Aug 2003 07:21:14 -0000 1.69.2.2 --- manager.py 5 Aug 2003 22:57:35 -0000 1.69.2.3 *************** *** 724,727 **** --- 724,748 ---- # And re-save now, just incase Outlook dies on the way down. self.SaveConfig() + + def ShowHtml(self,fileName): + """Displays the main SpamBayes documentation in your Web browser""" + import sys, os + if hasattr(sys, "frozen"): + # Same directory as to the executable. + fname = os.path.join(os.path.dirname(sys.argv[0]), + fileName) + else: + # (ie, main Outlook2000) dir + fname = os.path.join(os.path.dirname(__file__), + fileName) + fname = os.path.abspath(fname) + from dialogs import SetWaitCursor + if os.path.isfile(fname): + SetWaitCursor(1) + os.startfile(fname) + SetWaitCursor(0) + else: + print "Cant find ",fileName," - fix messagebox" + #self.MessageBox("Can't find "+fileName) _mgr = None From xenogeist at users.sourceforge.net Tue Aug 5 20:15:55 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Tue Aug 5 22:15:59 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.86.2.1, 1.86.2.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv17289/Outlook2000 Modified Files: Tag: outlook-dialog-branch addin.py Log Message: Move the html menu options to a Help sub-menu. People will need to delete the outlook.cmd file to get the old ones to go away. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.86.2.1 retrieving revision 1.86.2.2 diff -C2 -d -r1.86.2.1 -r1.86.2.2 *** addin.py 5 Aug 2003 22:57:35 -0000 1.86.2.1 --- addin.py 6 Aug 2003 02:15:53 -0000 1.86.2.2 *************** *** 784,801 **** Visible=True, Tag = "SpamBayesCommand.CheckVersion") ! self._AddControl(popup, ! constants.msoControlButton, ! ButtonEvent, (ShowAbout, self.manager,), ! Caption="About SpamBayes", ! Enabled=True, ! Visible=True, ! Tag = "SpamBayesCommand.ShowAbout") ! self._AddControl(popup, ! constants.msoControlButton, ! ButtonEvent, (ShowTroubleshooting, self.manager,), ! Caption="Troubleshooting Guide", ! Enabled=True, ! Visible=True, ! Tag = "SpamBayesCommand.ShowTroubleshooting") # If we are running from Python sources, enable a few extra items if not hasattr(sys, "frozen"): --- 784,811 ---- Visible=True, Tag = "SpamBayesCommand.CheckVersion") ! helpPopup = self._AddControl( ! popup, ! constants.msoControlPopup, ! None, None, ! Caption="Help", ! TooltipText = "SpamBayes help documents", ! Enabled = True, ! Tag = "SpamBayesCommand.HelpPopup") ! if helpPopup is not None: ! helpPopup = CastTo(helpPopup, "CommandBarPopup") ! self._AddControl(helpPopup, ! constants.msoControlButton, ! ButtonEvent, (ShowAbout, self.manager,), ! Caption="About SpamBayes", ! Enabled=True, ! Visible=True, ! Tag = "SpamBayesCommand.Help.ShowAbout") ! self._AddControl(helpPopup, ! constants.msoControlButton, ! ButtonEvent, (ShowTroubleshooting, self.manager,), ! Caption="Troubleshooting Guide", ! Enabled=True, ! Visible=True, ! Tag = "SpamBayesCommand.Help.ShowTroubleshooting") # If we are running from Python sources, enable a few extra items if not hasattr(sys, "frozen"): From mhammond at users.sourceforge.net Tue Aug 5 22:11:37 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 6 00:11:41 2003 Subject: [Spambayes-checkins] website Makefile,1.9,1.10 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv2796 Modified Files: Makefile Log Message: Ensure we don't get a garbage Version.cfg generated if python fails. Index: Makefile =================================================================== RCS file: /cvsroot/spambayes/website/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile 31 Jul 2003 08:27:51 -0000 1.9 --- Makefile 6 Aug 2003 04:11:34 -0000 1.10 *************** *** 30,34 **** download/Version.cfg: $(VERSION_PY) ! python $(VERSION_PY) -g > download/Version.cfg local_install: --- 30,35 ---- download/Version.cfg: $(VERSION_PY) ! python $(VERSION_PY) -g > download/Version.cfg.tmp ! mv -f download/Version.cfg.tmp download/Version.cfg local_install: From mhammond at users.sourceforge.net Tue Aug 5 22:12:28 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 6 00:12:31 2003 Subject: [Spambayes-checkins] website donations.ht,NONE,1.1 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv2870 Added Files: donations.ht Log Message: Create a first cut at a 'donations' page. Not linked in yet. --- NEW FILE: donations.ht --- Title: Donations for the SpamBayes project Author-Email: SpamBayes@python.org Author: SpamBayes

    SpamBayes donations

    SpamBayes is free software. There is absolutely no obligation to pay any money to use or redistribute the software. However, the developers of the software consider the Python Software Foundation (PSF) a charity worthy of your support. A donation to the PSF would not only demonstrate your appreciation of this tool, but also help to advance the development of other Python-based open source tools in the future.

    About the PSF

    The PSF is a non-profit organization devoted to advancing the Python programming language. The PSF is a registered US non-profit organization, so all donations made by US residents will be fully tax deducatible (but see the PSF donations page for specific details).

    For more information on the PSF, please see the PSF web site.

    Why donate to the PSF?

    SpamBayes is written in the Python programming language. The developers of SpamBayes believe that if it were not for Python, SpamBayes would simply not exist - the productivity gains and ease of use made it possible for a bunch of hackers to experiment freely and somehow end up with this very nice tool.

    In addition, the developers are all strong advocates of Open Source Software. It gives us powerful, free tools we can use to develop software, but more importantly, the tools come with the ultimate technical reference - the source code. Therefore, we are able to fully understand and sometimes even fix the tools we rely on.

    Yeah yeah, but why donate to the PSF?

    Many different people have donated their time to this project, which makes it unreasonable for any individual to collect money. As the PSF is a registered non-profit and devoted to promoting Open Source Software, it seems the logical choice.

    What will the PSF do with my money? Will it be spent on SpamBayes?

    Your SpamBayes donation goes into the general PSF fund; it is not earmarked specifically for the SpamBayes project. In the future, the PSF may make additional funds available for SpamBayes, for some other worthy Open Source project, or for some other purpose within its charter. You may like to read the PSF Mission Statement for more details.

    OK, OK, where do I pay?

    Please make sure you have read this document, so you know exactly why you are giving money ('cos the software is so cool) and to whom (the PSF).

    To donate now using PayPal, simply click here

    From mhammond at users.sourceforge.net Wed Aug 6 00:56:23 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 6 02:56:28 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.86,1.87 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv23428 Modified Files: addin.py Log Message: Don't update the image, caption and tooltip text for the buttons every time we startup. This also avoids clobbering the clipboard as we start. Fixes [ 780819 ] Images pasted to clipboard each startup (but doesn't fix the crashes :( ) Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** addin.py 4 Aug 2003 00:56:07 -0000 1.86 --- addin.py 6 Aug 2003 06:56:21 -0000 1.87 *************** *** 561,573 **** class ButtonDeleteAsSpamEvent(ButtonDeleteAsEventBase): - def Init(self, manager, explorer): - ButtonDeleteAsEventBase.Init(self, manager, explorer) - image = "delete_as_spam.bmp" - self.Caption = "Delete As Spam" - self.TooltipText = \ - "Move the selected message to the Spam folder,\n" \ - "and train the system that this is Spam." - SetButtonImage(self, image, manager) - def OnClick(self, button, cancel): msgstore = self.manager.message_store --- 561,564 ---- *************** *** 623,637 **** class ButtonRecoverFromSpamEvent(ButtonDeleteAsEventBase): - def Init(self, manager, explorer): - ButtonDeleteAsEventBase.Init(self, manager, explorer) - image = "recover_ham.bmp" - self.Caption = "Recover from Spam" - self.TooltipText = \ - "Recovers the selected item back to the folder\n" \ - "it was filtered from (or to the Inbox if this\n" \ - "folder is not known), and trains the system that\n" \ - "this is a good message\n" - SetButtonImage(self, image, manager) - def OnClick(self, button, cancel): msgstore = self.manager.message_store --- 614,617 ---- *************** *** 724,740 **** activeExplorer = self assert self.toolbar is None, "Should not yet have a toolbar" ! # Add our "Delete as ..." and "Recover as" buttons self.but_delete_as = self._AddControl( None, constants.msoControlButton, ButtonDeleteAsSpamEvent, (self.manager, self), BeginGroup = False, ! Tag = "SpamBayesCommand.DeleteAsSpam") ! # And again for "Recover as" self.but_recover_as = self._AddControl( None, constants.msoControlButton, ButtonRecoverFromSpamEvent, (self.manager, self), ! Tag = "SpamBayesCommand.RecoverFromSpam") # The main tool-bar dropdown with all our entries. --- 704,734 ---- activeExplorer = self assert self.toolbar is None, "Should not yet have a toolbar" ! ! # Add our "Delete as ..." and "Recover from" buttons ! tt_text = "Move the selected message to the Spam folder,\n" \ ! "and train the system that this is Spam." self.but_delete_as = self._AddControl( None, constants.msoControlButton, ButtonDeleteAsSpamEvent, (self.manager, self), + Caption="Delete As Spam", + TooltipText = tt_text, BeginGroup = False, ! Tag = "SpamBayesCommand.DeleteAsSpam", ! image = "delete_as_spam.bmp") ! # And again for "Recover from" ! tt_text = \ ! "Recovers the selected item back to the folder\n" \ ! "it was filtered from (or to the Inbox if this\n" \ ! "folder is not known), and trains the system that\n" \ ! "this is a good message\n" self.but_recover_as = self._AddControl( None, constants.msoControlButton, ButtonRecoverFromSpamEvent, (self.manager, self), ! Caption="Recover from Spam", ! TooltipText = tt_text, ! Tag = "SpamBayesCommand.RecoverFromSpam", ! image = "recover_ham.bmp") # The main tool-bar dropdown with all our entries. *************** *** 807,810 **** --- 801,809 ---- # that. assert item_attrs.has_key('Tag'), "Need a 'Tag' attribute!" + image_fname = None + if 'image' in item_attrs: + image_fname = item_attrs['image'] + del item_attrs['image'] + tag = item_attrs["Tag"] item = self.CommandBars.FindControl( *************** *** 852,855 **** --- 851,863 ---- print "FAILED to add the toolbar item '%s' - %s" % (tag,e) return + if image_fname: + # Eeek - only available in derived class. + assert control_type == constants.msoControlButton + but = CastTo(item, "_CommandBarButton") + SetButtonImage(but, image_fname, self.manager) + # Set the extra attributes passed in. + for attr, val in item_attrs.items(): + setattr(item, attr, val) + # Hook events for the item, but only if we haven't already in some # other explorer instance. *************** *** 860,866 **** # as the item destructs. self.explorers_collection.button_event_map[tag] = item - # Set the extra attributes passed in. - for attr, val in item_attrs.items(): - setattr(item, attr, val) return item --- 868,871 ---- From anadelonbrin at users.sourceforge.net Wed Aug 6 17:04:06 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 6 19:04:09 2003 Subject: [Spambayes-checkins] spambayes imapfilter.py,1.49,1.50 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv9707 Modified Files: imapfilter.py Log Message: Broken by Python 2.3, but my fault. Fix for: [ 784296 ] imapfilter broken with Python 2.3 Index: imapfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/imapfilter.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** imapfilter.py 24 Jun 2003 06:16:27 -0000 1.49 --- imapfilter.py 6 Aug 2003 23:04:04 -0000 1.50 *************** *** 229,233 **** # We *always* use SELECT and not EXAMINE, because this # speeds things up considerably. ! response = self.select(folder, False) if response[0] != "OK": print "Invalid response to select %s:\n%s" % (folder, --- 229,233 ---- # We *always* use SELECT and not EXAMINE, because this # speeds things up considerably. ! response = self.select(folder, None) if response[0] != "OK": print "Invalid response to select %s:\n%s" % (folder, From montanaro at users.sourceforge.net Wed Aug 6 18:01:10 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 6 20:01:13 2003 Subject: [Spambayes-checkins] spambayes/spambayes dbmstorage.py,1.5,1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv18514 Modified Files: dbmstorage.py Log Message: remove dumbdbm from the possible dbm storage options Index: dbmstorage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/dbmstorage.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dbmstorage.py 14 Jul 2003 12:08:17 -0000 1.5 --- dbmstorage.py 7 Aug 2003 00:01:07 -0000 1.6 *************** *** 23,34 **** return gdbm.open(*args) - def open_dumbdbm(*args): - """Open a dumbdbm database.""" - import dumbdbm - db = dumbdbm.open(*args) - if not hasattr(db, "sync"): - db.sync = db._commit - return db - def open_best(*args): if sys.platform == "win32": --- 23,26 ---- *************** *** 39,43 **** funcs.insert(0, open_dbhash) else: ! funcs = [open_db3hash, open_dbhash, open_gdbm, open_dumbdbm] for f in funcs: try: --- 31,35 ---- funcs.insert(0, open_dbhash) else: ! funcs = [open_db3hash, open_dbhash, open_gdbm] for f in funcs: try: *************** *** 52,56 **** "dbhash": open_dbhash, "gdbm": open_gdbm, - "dumbdbm": open_dumbdbm, } --- 44,47 ---- From montanaro at users.sourceforge.net Wed Aug 6 18:05:17 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 6 20:05:20 2003 Subject: [Spambayes-checkins] spambayes/spambayes dbmstorage.py,1.6,1.7 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv19169 Modified Files: dbmstorage.py Log Message: missed an occurrence of dumdbm in the win32 branch Index: dbmstorage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/dbmstorage.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dbmstorage.py 7 Aug 2003 00:01:07 -0000 1.6 --- dbmstorage.py 7 Aug 2003 00:05:14 -0000 1.7 *************** *** 27,31 **** # Note that Python 2.3 and later ship with the new bsddb interface # as the default bsddb module - so 2.3 can use the old name safely. ! funcs = [open_db3hash, open_gdbm, open_dumbdbm] if sys.version_info >= (2,3): funcs.insert(0, open_dbhash) --- 27,31 ---- # Note that Python 2.3 and later ship with the new bsddb interface # as the default bsddb module - so 2.3 can use the old name safely. ! funcs = [open_db3hash, open_gdbm] if sys.version_info >= (2,3): funcs.insert(0, open_dbhash) From anadelonbrin at users.sourceforge.net Wed Aug 6 18:11:03 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 6 20:11:06 2003 Subject: [Spambayes-checkins] spambayes/spambayes Options.py,1.60,1.61 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv19812/spambayes Modified Files: Options.py Log Message: Remove dumbdbm from the options presented since Skip got round to taking it out (it was on my to-do list, honest! :) Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Options.py 29 Jul 2003 06:32:48 -0000 1.60 --- Options.py 7 Aug 2003 00:11:01 -0000 1.61 *************** *** 916,924 **** ("dbm_type", "Database storage type", "best", ! """What DBM storage type should we use? Must be best, db3hash, dbhash, ! gdbm, or dumbdbm. Windows folk should steer clear of dbhash. Default is "best", which will pick the best DBM type available on your platform.""", ! ("best", "db3hash", "dbhash", "gdbm", "dumbdbm"), RESTORE), ("proxy_username", "HTTP Proxy Username", "", --- 916,924 ---- ("dbm_type", "Database storage type", "best", ! """What DBM storage type should we use? Must be best, db3hash, ! dbhash or gdbm. Windows folk should steer clear of dbhash. Default is "best", which will pick the best DBM type available on your platform.""", ! ("best", "db3hash", "dbhash", "gdbm"), RESTORE), ("proxy_username", "HTTP Proxy Username", "", From anadelonbrin at users.sourceforge.net Wed Aug 6 18:28:16 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 6 20:28:20 2003 Subject: [Spambayes-checkins] website donations.ht,1.1,1.2 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv21995 Modified Files: donations.ht Log Message: Typo. Index: donations.ht =================================================================== RCS file: /cvsroot/spambayes/website/donations.ht,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** donations.ht 6 Aug 2003 04:12:26 -0000 1.1 --- donations.ht 7 Aug 2003 00:28:14 -0000 1.2 *************** *** 16,20 **** Python programming language. The PSF is a registered US non-profit organization, so all donations made by US residents will be fully tax ! deducatible (but see the PSF donations page for specific details).

    --- 16,20 ---- Python programming language. The PSF is a registered US non-profit organization, so all donations made by US residents will be fully tax ! deductible (but see the PSF donations page for specific details).

    From tim_one at users.sourceforge.net Wed Aug 6 18:51:41 2003 From: tim_one at users.sourceforge.net (Tim Peters) Date: Wed Aug 6 20:51:45 2003 Subject: [Spambayes-checkins] website donations.ht,1.2,1.3 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv24564/website Modified Files: donations.ht Log Message: Trimmed trailing whitespace; reworded the PSF verbiage a bit (e.g., contributions to non-profits aren't necessarily deductible in the US, "public charity" is the magical phrase). Index: donations.ht =================================================================== RCS file: /cvsroot/spambayes/website/donations.ht,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** donations.ht 7 Aug 2003 00:28:14 -0000 1.2 --- donations.ht 7 Aug 2003 00:51:39 -0000 1.3 *************** *** 14,38 ****

    About the PSF

    The PSF is a non-profit organization devoted to advancing the ! Python programming language. The PSF is a registered US non-profit ! organization, so all donations made by US residents will be fully tax ! deductible (but see the PSF donations page ! for specific details).

    !

    For more information on the PSF, please see the PSF web site.

    Why donate to the PSF?

    !

    SpamBayes is written in the ! Python programming language. The ! developers of SpamBayes believe that if it were not for Python, SpamBayes ! would simply not exist - the productivity gains and ease of use made it ! possible for a bunch of hackers to experiment freely and somehow end up with this very nice tool.

    !

    In addition, the developers are all strong advocates of Open Source Software. It gives us powerful, free tools we can use to develop software, ! but more importantly, the tools come with the ultimate technical reference - ! the source code. Therefore, we are able to fully understand and sometimes even fix the tools we rely on.

    --- 14,38 ----

    About the PSF

    The PSF is a non-profit organization devoted to advancing the ! Python programming language. The PSF is a public charity under US ! tax law, and all donations made by US residents are tax ! deductible (see the PSF donations page ! for details).

    !

    For more information on the PSF, please see the PSF web site.

    Why donate to the PSF?

    !

    SpamBayes is written in the ! Python programming language. The ! developers of SpamBayes believe that if it were not for Python, SpamBayes ! would simply not exist - the productivity gains and ease of use made it ! possible for a bunch of hackers to experiment freely and somehow end up with this very nice tool.

    !

    In addition, the developers are all strong advocates of Open Source Software. It gives us powerful, free tools we can use to develop software, ! but more importantly, the tools come with the ultimate technical reference - ! the source code. Therefore, we are able to fully understand and sometimes even fix the tools we rely on.

    *************** *** 40,56 ****

    Yeah yeah, but why donate to the PSF?

    Many different people have donated their time to this project, which makes ! it unreasonable for any individual to collect money. As the PSF is a registered non-profit and devoted to promoting Open Source Software, it seems the logical choice.

    What will the PSF do with my money? Will it be spent on SpamBayes?

    !

    Your SpamBayes donation goes into the general PSF fund; it is not earmarked specifically for the SpamBayes project. In the future, the PSF may make additional funds available for SpamBayes, for some other worthy Open Source project, or for some other purpose within its charter. You ! may like to read the ! PSF Mission Statement for more details.

    !

    OK, OK, where do I pay?

    Please make sure you have read this document, so you know exactly --- 40,56 ----

    Yeah yeah, but why donate to the PSF?

    Many different people have donated their time to this project, which makes ! it unreasonable for any individual to collect money. As the PSF is a registered non-profit and devoted to promoting Open Source Software, it seems the logical choice.

    What will the PSF do with my money? Will it be spent on SpamBayes?

    !

    Your SpamBayes donation goes into the general PSF fund; it is not earmarked specifically for the SpamBayes project. In the future, the PSF may make additional funds available for SpamBayes, for some other worthy Open Source project, or for some other purpose within its charter. You ! may like to read the ! PSF Mission Statement for more details.

    !

    OK, OK, where do I pay?

    Please make sure you have read this document, so you know exactly *************** *** 68,72 **** --- 68,72 ---- From anadelonbrin at users.sourceforge.net Wed Aug 6 19:14:03 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 6 21:14:07 2003 Subject: [Spambayes-checkins] website style.css,1.7,1.8 unix.ht,1.3,1.4 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv28153 Modified Files: style.css unix.ht Log Message: Make links slightly more visible for those viewing without links underlined. Flesh out the unix page a bit more based on a combination of a doc that I was send as a contribution (some time ago) and the INTEGRATION.TXT file. Note that I don't use unix so I'm trusting the two of these to be right ;) Index: style.css =================================================================== RCS file: /cvsroot/spambayes/website/style.css,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** style.css 28 May 2003 19:41:31 -0000 1.7 --- style.css 7 Aug 2003 01:13:59 -0000 1.8 *************** *** 9,13 **** } ! A:link { color: #645460; } A:visited { color: #303030; } A:active { color: #ff9933; } --- 9,13 ---- } ! A:link { color: #8454A0; } A:visited { color: #303030; } A:active { color: #ff9933; } Index: unix.ht =================================================================== RCS file: /cvsroot/spambayes/website/unix.ht,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** unix.ht 29 Jul 2003 01:48:02 -0000 1.3 --- unix.ht 7 Aug 2003 01:14:00 -0000 1.4 *************** *** 20,27 **** local spool file (e.g. /var/spool/mail), you will probably find hammiefilter.py the easiest application to integrate into your mail ! environment. Details are available in the Hammie ! integration guide. (XXX: More of what's there needs to be incorporated ! here.)

    POP3

    --- 20,53 ---- local spool file (e.g. /var/spool/mail), you will probably find hammiefilter.py the easiest application to integrate into your mail ! environment.

    !

    An example setup is as follows (thanks to Alister Forbes for contributing this): !

      !
    1. Install spambayes with the usual
      setup.py install
    2. !
    3. Create the database that spambayes will use to test your incoming mail: !
      /usr/local/bin/hammiefilter.py -d $HOME/.hammie.db -n
    4. !
    5. Train it on your existing mail. This is optional, but a good idea. -g is the flag for the known good mail, and -s is for known spam !
      /usr/local/bin/mboxtrain.py -d $HOME/.hammiedb -g $HOME/Mail/inbox -s $HOME/Mail/spam
    6. !
    7. Adding the following recipes to the top of your .procmailrc will get the spam and unsure stuff out of the way. Allowing everything else to be filtered as per your normal procmail recipes. !
      !       :0fw:hamlock
      !       | /usr/local/bin/hammiefilter.py
      ! 
      !       :0
      !       * ^X-Spambayes-Classification: spam 
      !       ${MAILDIR}/spam
      !       
      !       :0
      !       * ^X-Spambayes-Classification: unsure
      !       ${MAILDIR}/unsure
      ! 
      !
    8. !
    9. For ongoing training, there is a handy little cronjob that will run at 2:21 am every morning, training the database with good mail from Inbox and spam from caughtspam. Just add the following to your crontab !
      21 2 * * * /usr/local/bin/mboxtrain.py -d $HOME/.hammiedb -g $HOME/Mail/Inbox -s $HOME/Mail/spam
      !
    10. !
    !

    !

    Additional details are available in the Hammie ! integration guide.

    POP3

    From anadelonbrin at users.sourceforge.net Wed Aug 6 19:27:42 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 6 21:27:45 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 about.html, 1.17, 1.17.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv30043/Outlook2000 Modified Files: Tag: outlook-dialog-branch about.html Log Message: Typo. Index: about.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/about.html,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -C2 -d -r1.17 -r1.17.2.1 *** about.html 31 Jul 2003 12:28:48 -0000 1.17 --- about.html 7 Aug 2003 01:27:40 -0000 1.17.2.1 *************** *** 103,107 **** the plugin If you download the installer version of this plugin (ie, you ! downloaded a .EXE file you use to install), then everthing is installed and just needs to be configured.  If you downloaded the sourcecode version of the plugin, please view README.txt for installation --- 103,107 ---- the plugin If you download the installer version of this plugin (ie, you ! downloaded a .EXE file you use to install), then everything is installed and just needs to be configured.  If you downloaded the sourcecode version of the plugin, please view README.txt for installation From montanaro at users.sourceforge.net Wed Aug 6 19:39:14 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 6 21:39:17 2003 Subject: [Spambayes-checkins] spambayes/spambayes storage.py,1.16,1.17 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv31616 Modified Files: storage.py Log Message: **** Danger, Will Robinson! Do not use the PGClassifier class yet! **** This is an initial stab at SQLClassifier and PGClassifier classes. This still needs a lot of work, to wit: * I've tried to break functionality into the two classes in such a way that adding other SQLClassifier subclasses should be reasonably easy, but I don't know much about writing portable SQL. Python's DB API helps, to be sure, but isn't perfect. * Scoring messages is dreadfully slow. I don't know if I'm commit()ing too frequently, creating too many cursors or if I have some other problem. My past use of SQL has generally been of the "scads of SELECTs per INSERT" sort of thing, so I've never paid a lot of attention to commit(). * I've encountered a couple bad cases. With the word column defined as bytea (PostgreSQL's binary string type), both of these calls fail if c is a cursor object: c.execute("select * from bayes where word=%s", ('report.\\n";',)) c.execute("select * from bayes where word=%s", ('reserved\x00',)) If the word column is defined as the more traditional varchar(128), the first call succeeds but the second still fails. Index: storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** storage.py 25 Jul 2003 05:17:22 -0000 1.16 --- storage.py 7 Aug 2003 01:39:12 -0000 1.17 *************** *** 258,261 **** --- 258,417 ---- self.changed_words[word] = WORD_DELETED + + class SQLClassifier(classifier.Classifier): + def __init__(self, db_name): + '''Constructor(database name)''' + + classifier.Classifier.__init__(self) + self.statekey = "saved state" + self.db_name = db_name + self.load() + + def load(self): + '''Load state from the database''' + raise NotImplementedError, "must be implemented in subclass" + + def store(self): + '''Save state to the database''' + self._set_row(self.statekey, self.nspam, self.nham) + + def cursor(self): + '''Return a new db cursor''' + raise NotImplementedError, "must be implemented in subclass" + + def fetchall(self, c): + '''Return all rows as a dict''' + raise NotImplementedError, "must be implemented in subclass" + + def commit(self, c): + '''Commit the current transaction - may commit at db or cursor''' + raise NotImplementedError, "must be implemented in subclass" + + def create_bayes(self): + '''Create a new bayes table''' + c = self.cursor() + c.execute(self.table_definition) + self.commit(c) + + def _get_row(self, word): + '''Return row matching word''' + try: + c = self.cursor() + c.execute("select * from bayes" + " where word=%s", + (word,)) + except Exception, e: + print "error:", (e, word) + raise + rows = self.fetchall(c) + + if rows: + return rows[0] + else: + return {} + + def _set_row(self, word, nspam, nham): + c = self.cursor() + if self._has_key(word): + c.execute("update bayes" + " set nspam=%s,nham=%s" + " where word=%s", + (nspam, nham, word)) + else: + c.execute("insert into bayes" + " (nspam, nham, word)" + " values (%s, %s, %s)", + (nspam, nham, word)) + self.commit(c) + + def _delete_row(self, word): + c = self.cursor() + c.execute("delete from bayes" + " where word=%s", + (word,)) + self.commit(c) + + def _has_key(self, key): + c = self.cursor() + c.execute("select word from bayes" + " where word=%s", + (key,)) + return len(self.fetchall(c)) > 0 + + def _wordinfoget(self, word): + if isinstance(word, unicode): + word = word.encode("utf-8") + + row = self._get_row(word) + if row: + item = self.WordInfoClass() + item.__setstate__((row["nspam"], row["nham"])) + return item + else: + return self.WordInfoClass() + + def _wordinfoset(self, word, record): + if isinstance(word, unicode): + word = word.encode("utf-8") + self._set_row(word, record.spamcount, record.hamcount) + + def _wordinfodel(self, word): + if isinstance(word, unicode): + word = word.encode("utf-8") + self._delete_row(word) + + + class PGClassifier(SQLClassifier): + '''Classifier object persisted in a Postgres database''' + def __init__(self, db_name): + self.table_definition = ("create table bayes (" + " word bytea not null default ''," + " nspam integer not null default 0," + " nham integer not null default 0," + " primary key(word)" + ")") + SQLClassifier.__init__(self, db_name) + + def cursor(self): + return self.db.cursor() + + def fetchall(self, c): + return c.dictfetchall() + + def commit(self, c): + self.db.commit() + + def load(self): + '''Load state from database''' + + import psycopg + + if options.verbose: + print 'Loading state from',self.db_name,'database' + + self.db = psycopg.connect(self.db_name) + + c = self.cursor() + try: + c.execute("select count(*) from bayes") + except psycopg.ProgrammingError: + self.db.rollback() + self.create_bayes() + + if self._has_key(self.statekey): + row = self._get_row(self.statekey) + self.nspam = row["nspam"] + self.nham = row["nham"] + if options.verbose: + print '%s is an existing database, with %d spam and %d ham' \ + % (self.db_name, self.nspam, self.nham) + else: + # new database + if options.verbose: + print self.db_name,'is a new database' + self.nspam = 0 + self.nham = 0 + + class Trainer: '''Associates a Classifier object and one or more Corpora, \ From anadelonbrin at users.sourceforge.net Wed Aug 6 19:50:27 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 6 21:50:30 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs/images manager-select.jpg, NONE, 1.1.2.1 manager.jpg, 1.1, 1.1.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs/images In directory sc8-pr-cvs1:/tmp/cvs-serv648/Outlook2000/docs/images Modified Files: Tag: outlook-dialog-branch manager.jpg Added Files: Tag: outlook-dialog-branch manager-select.jpg Log Message: Another typo, plus some improvements (hopefully Mark agrees ;) based on some docs passed on to me by Brian Thomas. Note that these images are also for the current cvs on the dialogs branch, so they include those changes (such as the help submenu). --- NEW FILE: manager-select.jpg --- (This appears to be a binary file; contents omitted.) Index: manager.jpg =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/images/manager.jpg,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 Binary files /tmp/cvsUvgByY and /tmp/cvsUtotQM differ From anadelonbrin at users.sourceforge.net Wed Aug 6 19:50:27 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 6 21:50:34 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 about.html, 1.17.2.1, 1.17.2.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv648/Outlook2000 Modified Files: Tag: outlook-dialog-branch about.html Log Message: Another typo, plus some improvements (hopefully Mark agrees ;) based on some docs passed on to me by Brian Thomas. Note that these images are also for the current cvs on the dialogs branch, so they include those changes (such as the help submenu). Index: about.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/about.html,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -C2 -d -r1.17.2.1 -r1.17.2.2 *** about.html 7 Aug 2003 01:27:40 -0000 1.17.2.1 --- about.html 7 Aug 2003 01:50:25 -0000 1.17.2.2 *************** *** 99,103 **** system is also trained.  This makes it less likely that another similar mail will be incorrectly classified in the future.
    !

    Installing and Configuring the plugin

    --- 99,103 ---- system is also trained.  This makes it less likely that another similar mail will be incorrectly classified in the future.
    !

    Installing and Configuring the plugin

    *************** *** 106,111 **** and just needs to be configured.  If you downloaded the sourcecode version of the plugin, please view README.txt for installation ! instructions.
    ! Configuring the plugin requires the following steps:
    --- 106,111 ---- and just needs to be configured.  If you downloaded the sourcecode version of the plugin, please view README.txt for installation ! instructions.
    ! Configuring the plugin requires the following steps:

    *************** *** 114,118 ****
      !
    1. Confirm the plugin is installed:
      Start Outlook, select your Inbox, then look at your Outlook toolbar.  Just below the standard Toolbar, you should see a new --- 114,118 ----
      !
    1. Confirm the plugin is installed:
      Start Outlook, select your Inbox, then look at your Outlook toolbar.  Just below the standard Toolbar, you should see a new *************** *** 122,127 **** appear, please see the troubleshooting guide.
    2. !
    3. Create Spam and Usure folders
      Use the normal Outlook functions to create two new folders.  These can be named anything you like, and can appear anywhere in the folder --- 122,127 ---- appear, please see the troubleshooting guide.
    4. !
    5. Create ! Spam and Unsure folders
      Use the normal Outlook functions to create two new folders.  These can be named anything you like, and can appear anywhere in the folder *************** *** 129,133 **** something like Spam and Possible Spam.
    6. !
    7. Manually create initial training data
      Go through your Inbox, Deleted Items and any other folders likely to have spam, and move as much as possible --- 129,133 ---- something like Spam and Possible Spam.
    8. !
    9. Manually create initial training data
      Go through your Inbox, Deleted Items and any other folders likely to have spam, and move as much as possible *************** *** 136,140 **** of good messages we train on.  Don't worry too much about missing one or two spam - the system is likely to find them for you as we ! rescore your existing email.
      If your Inbox is so full of Spam you don't know where to start, you may like to create a temporary folder for the purposes of training your --- 136,140 ---- of good messages we train on.  Don't worry too much about missing one or two spam - the system is likely to find them for you as we ! rescore your existing email.

      If your Inbox is so full of Spam you don't know where to start, you may like to create a temporary folder for the purposes of training your *************** *** 142,148 **** new folder (roughly the same number as Spam you are training on is best) and nominate this temporary folder instead of your Inbox.  ! Once trained, you can dispose of this folder.
      !
    10. !
    11. Configure and Train SpamBayes
      Now we have our folders setup with some initial training data, we can configure the plugin.  From the SpamBayes --- 142,147 ---- new folder (roughly the same number as Spam you are training on is best) and nominate this temporary folder instead of your Inbox.  ! Once trained, you can dispose of this folder.
    12. !
    13. Configure and Train SpamBayes
      Now we have our folders setup with some initial training data, we can configure the plugin.  From the SpamBayes *************** *** 150,161 **** Manager...  This will display the main dialog, as shown to the right.
    14. !
    15. Select Train Now, and the training dialog, also shown to the right will appear.  You will need to select your Inbox as the folder for good messages, and your new Spam folder as the source of junk messages.  Ensure that Score messages after training is selected, so we can see how effective ! our Inbox cleanup was.
      !
    16. !
    17. Click on the Train Now button, and a progress indicator will be displayed as your messages are trained and scored.  When finished, close the training window to return --- 149,159 ---- Manager...  This will display the main dialog, as shown to the right.
    18. !
    19. Select Train Now, and the training dialog, also shown to the right will appear.  You will need to select your Inbox as the folder for good messages, and your new Spam folder as the source of junk messages.  Ensure that Score messages after training is selected, so we can see how effective ! our Inbox cleanup was.
    20. !
    21. Click on the Train Now button, and a progress indicator will be displayed as your messages are trained and scored.  When finished, close the training window to return *************** *** 164,169 ****
    Anti-Spam manager
    The SpamBayes Manager dialog

    --- 162,171 ----
    SpamBayes Toolbar
    !
    The SpamBayes Toolbar
    !
    ! SpamBayes manager
    The SpamBayes Manager dialog

    From anadelonbrin at users.sourceforge.net Wed Aug 6 19:52:27 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 6 21:52:30 2003 Subject: [Spambayes-checkins] website style.css,1.8,1.9 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv1144 Modified Files: style.css Log Message: Change the "visited link" colour a bit too, in case people who don't underline forget where they clicked. Again, feel free to override my colour choices ;) Index: style.css =================================================================== RCS file: /cvsroot/spambayes/website/style.css,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** style.css 7 Aug 2003 01:13:59 -0000 1.8 --- style.css 7 Aug 2003 01:52:25 -0000 1.9 *************** *** 10,14 **** A:link { color: #8454A0; } ! A:visited { color: #303030; } A:active { color: #ff9933; } --- 10,14 ---- A:link { color: #8454A0; } ! A:visited { color: #503070; } A:active { color: #ff9933; } From anadelonbrin at users.sourceforge.net Wed Aug 6 23:04:11 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Aug 7 01:04:14 2003 Subject: [Spambayes-checkins] spambayes/spambayes storage.py,1.17,1.18 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv26785/spambayes Modified Files: storage.py Log Message: Add a MySQLdb based classifier. Index: storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** storage.py 7 Aug 2003 01:39:12 -0000 1.17 --- storage.py 7 Aug 2003 05:04:09 -0000 1.18 *************** *** 6,9 **** --- 6,11 ---- PickledClassifier - Classifier that uses a pickle db DBDictClassifier - Classifier that uses a shelve db + PGClassifier - Classifier that uses postgres + mySQLClassifier - Classifier that uses mySQL Trainer - Classifier training observer SpamTrainer - Trainer for spam *************** *** 13,16 **** --- 15,20 ---- *Classifier are subclasses of Classifier (classifier.Classifier) that add automatic state store/restore function to the Classifier class. + All SQL based classifiers are subclasses of SQLClassifier, which is a + subclass of Classifier. PickledClassifier is a Classifier class that uses a cPickle *************** *** 412,415 **** --- 416,502 ---- self.nspam = 0 self.nham = 0 + + + class mySQLClassifier(SQLClassifier): + '''Classifier object persisted in a mySQL database + + It is assumed that the database already exists, and that the mySQL + server is currently running.''' + + def __init__(self, data_source_name): + self.table_definition = ("create table bayes (" + " word varchar(255) not null default ''," + " nspam integer not null default 0," + " nham integer not null default 0," + " primary key(word)" + ");") + self.host = "localhost" + self.username = "root" + self.password = "" + db_name = "spambayes" + source_info = data_source_name.split() + for info in source_info: + if info.startswith("host"): + self.host = info[5:] + elif info.startswith("user"): + self.username = info[5:] + elif info.startswith("pass"): + self.username = info[5:] + elif info.startswith("dbname"): + db_name = info[7:] + SQLClassifier.__init__(self, db_name) + + def cursor(self): + return self.db.cursor() + + def fetchall(self, c): + return c.fetchall() + + def commit(self, c): + self.db.commit() + + def load(self): + '''Load state from database''' + + import MySQLdb + + if options.verbose: + print 'Loading state from',self.db_name,'database' + + self.db = MySQLdb.connect(host=self.host, db=self.db_name, + user=self.username, passwd=self.password) + + c = self.cursor() + try: + c.execute("select count(*) from bayes") + except MySQLdb.ProgrammingError: + self.db.rollback() + self.create_bayes() + + if self._has_key(self.statekey): + row = self._get_row(self.statekey) + self.nspam = int(row[1]) + self.nham = int(row[2]) + if options.verbose: + print '%s is an existing database, with %d spam and %d ham' \ + % (self.db_name, self.nspam, self.nham) + else: + # new database + if options.verbose: + print self.db_name,'is a new database' + self.nspam = 0 + self.nham = 0 + + def _wordinfoget(self, word): + if isinstance(word, unicode): + word = word.encode("utf-8") + + row = self._get_row(word) + if row: + item = self.WordInfoClass() + item.__setstate__((row[1], row[2])) + return item + else: + return None From mhammond at users.sourceforge.net Thu Aug 7 00:23:53 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Aug 7 02:23:57 2003 Subject: [Spambayes-checkins] website donations.ht, 1.3, 1.4 faq.txt, 1.24, 1.25 links.h, 1.9, 1.10 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv5472 Modified Files: donations.ht faq.txt links.h Log Message: Change the FAQ re donations etc, move a little of Tim's text from the FAQ into the donations page, and add a 'donate' link to the nav bar. Index: donations.ht =================================================================== RCS file: /cvsroot/spambayes/website/donations.ht,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** donations.ht 7 Aug 2003 00:51:39 -0000 1.3 --- donations.ht 7 Aug 2003 06:23:51 -0000 1.4 *************** *** 48,53 **** earmarked specifically for the SpamBayes project. In the future, the PSF may make additional funds available for SpamBayes, for some other worthy ! Open Source project, or for some other purpose within its charter. You ! may like to read the PSF Mission Statement for more details.

    --- 48,61 ---- earmarked specifically for the SpamBayes project. In the future, the PSF may make additional funds available for SpamBayes, for some other worthy ! Open Source project, or for some other purpose within its charter.

    ! !

    Open Source has a great history of producing fine code, ! but less so when it comes to performing the kinds of research required ! for these kinds of projects (research on statistical algorithms is ! time-consuming and tedious, and there's no a priori guarantee of success). ! One thing the PSF hopes to do in coming years is fund the core research ! needed to springboard these kinds of projects.

    ! !

    You may like to read the PSF Mission Statement for more details.

    Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** faq.txt 4 Aug 2003 07:51:14 -0000 1.24 --- faq.txt 7 Aug 2003 06:23:51 -0000 1.25 *************** *** 58,61 **** --- 58,86 ---- filters (to file away suspected spam into its own mail folder, for example). + What is the license? How much does it cost? Can I pay anyway? + ------------------------------------------------------------- + + SpamBayes is free and open-source - there is no charge. The software + is released under `the PSA license`_. + + If you really feel that your life would be incomplete without giving + something back to the project, you have a few options: + + * Donate you time to help improve the project. This includes many + items that do not require much in the way of technical skills. See + the `I'm not a programmer but still want to help`_ question for more + details. + + * Dontate money to the Python Software Foundations. For more + information, including why you would want to donate to the PSF, + please see our `donations page`_. + + * Investigate some of the commercial programs based on the SpamBayes code. + This should give you some additional benefits like support or greater + ease-of-use. + + .. _the PSA license: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/spambayes/spambayes/LICENSE.txt + .. _I'm not a programmer but still want to help: #i-m-not-a-programmer-but-want-to-help-out-what-can-i-do + .. _donations page: donations.html What online resources are available? *************** *** 735,766 **** numbers (3 and 12) were determined by brute force testing, and produced the best overall results (including compared to no upper or lower limits). - - - Do I have to pay for SpamBayes? Can I pay you money if I really want to? - ------------------------------------------------------------------------- - - SpamBayes is free and open-source - there is no charge, and we really - aren't interested in your money (on the other hand, if you want to donate - time towards testing, documenting or development - please sign up!). - - If you really feel that your life would be incomplete without giving some - money towards the project, you have a couple of options. There are some - commercial programs that are based on the SpamBayes code, so you could - purchase one of those; this should give you some additional benefits like - support or greater ease-of-use as well. - - The employer of one of the project's - founders (Tim Peters) paid for the initial research and coding on the - SpamBayes project. Open source does very well at the latter but not so - well at the former (research on statistical algorithms is time-consuming - and tedious, and there's no a priori guarantee of success). One thing the - `Python Software Foundation (PSF)`_ hopes to do in coming years is fund - core research -- but last time they worked out the details, it seemed to - require some funds first . Therefore, if you'd rather contribute - closer to the SpamBayes source, the PSF would be the most appropriate place - to invest your life's savings. - - .. _Python Software Foundation (PSF): http://www.python.org/psf/donations.html - I'm not a programmer, but want to help out - what can I do? --- 760,763 ---- Index: links.h =================================================================== RCS file: /cvsroot/spambayes/website/links.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** links.h 23 May 2003 03:08:37 -0000 1.9 --- links.h 7 Aug 2003 06:23:51 -0000 1.10 *************** *** 6,9 **** --- 6,10 ----
  • Developers
  • Related +
  • Donate

    Platforms

  • Windows From anadelonbrin at users.sourceforge.net Thu Aug 7 00:40:05 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Aug 7 02:40:09 2003 Subject: [Spambayes-checkins] website faq.txt,1.25,1.26 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv7133 Modified Files: faq.txt Log Message: Typo. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** faq.txt 7 Aug 2003 06:23:51 -0000 1.25 --- faq.txt 7 Aug 2003 06:40:03 -0000 1.26 *************** *** 67,71 **** something back to the project, you have a few options: ! * Donate you time to help improve the project. This includes many items that do not require much in the way of technical skills. See the `I'm not a programmer but still want to help`_ question for more --- 67,71 ---- something back to the project, you have a few options: ! * Donate your time to help improve the project. This includes many items that do not require much in the way of technical skills. See the `I'm not a programmer but still want to help`_ question for more From mhammond at users.sourceforge.net Thu Aug 7 20:52:03 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Aug 7 22:52:07 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.61,1.62 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv29153 Modified Files: msgstore.py Log Message: Fix [ 782709 ] not match between actual score and what's shown in outlook We can't trust potentially large properties in the data used to create the msg object. Thanks Tim, Tony, everyone. Index: msgstore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** msgstore.py 31 Jul 2003 12:30:00 -0000 1.61 --- msgstore.py 8 Aug 2003 02:52:01 -0000 1.62 *************** *** 348,352 **** return "".join(chunks) except pythoncom.com_error, d: ! print "Error getting property from stream", d return "" --- 348,353 ---- return "".join(chunks) except pythoncom.com_error, d: ! print "Error getting property", mapiutil.GetPropTagName(prop_id), \ ! "from stream:", d return "" *************** *** 507,510 **** --- 508,518 ---- # prop_row is a single mapi property row, with fields as above. + # NOTE: We can't trust these properties for "large" values + # (ie, strings, PT_BINARY, objects etc.), as they sometimes come + # from the IMAPITable (which has a 255 limit on property values) + # and sometimes from the object itself (which has no restriction). + # This limitation is documented by MAPI. + # Thus, we don't trust "PR_TRANSPORT_MESSAGE_HEADERS_A" more than + # to ask "does the property exist?" tag, eid = prop_row[0] # ID tag, store_eid = prop_row[1] *************** *** 520,533 **** self.msgclass = msgclass self.subject = subject ! if PROP_TYPE(headers_tag)==PT_STRING8: ! self.headers = headers ! has_headers = True ! else: ! # headers probably too big for simple property fetch - this is ! # the case if we got back MAPI_E_NOT_ENOUGH_MEMORY ! # (but don't bother fetching the header yet) ! has_headers = PROP_TYPE(headers_tag)==PT_ERROR and \ ! headers==mapi.MAPI_E_NOT_ENOUGH_MEMORY ! self.headers = None # Search key is the only reliable thing after a move/copy operation # only problem is that it can potentially be changed - however, the --- 528,532 ---- self.msgclass = msgclass self.subject = subject ! has_headers = PROP_TYPE(headers_tag)==PT_STRING8 # Search key is the only reliable thing after a move/copy operation # only problem is that it can potentially be changed - however, the *************** *** 601,617 **** self._EnsureObject() - if self.headers is None: # they were too large when created! - prop_ids = (PR_TRANSPORT_MESSAGE_HEADERS_A,) - hr, data = self.mapi_object.GetProps(prop_ids,0) - self.headers = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0]) - headers = self.headers - prop_ids = (PR_BODY_A, MYPR_BODY_HTML_A, ! PR_HASATTACH) hr, data = self.mapi_object.GetProps(prop_ids,0) body = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0]) html = self._GetPotentiallyLargeStringProp(prop_ids[1], data[1]) has_attach = data[2][1] # Some Outlooks deliver a strange notion of headers, including --- 600,612 ---- self._EnsureObject() prop_ids = (PR_BODY_A, MYPR_BODY_HTML_A, ! PR_HASATTACH, ! PR_TRANSPORT_MESSAGE_HEADERS_A) hr, data = self.mapi_object.GetProps(prop_ids,0) body = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0]) html = self._GetPotentiallyLargeStringProp(prop_ids[1], data[1]) has_attach = data[2][1] + headers = self._GetPotentiallyLargeStringProp(prop_ids[3], data[3]) # Some Outlooks deliver a strange notion of headers, including From mhammond at users.sourceforge.net Thu Aug 7 20:54:36 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Aug 7 22:54:40 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 msgstore.py, 1.61, 1.61.2.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv29482 Modified Files: Tag: outlook-dialog-branch msgstore.py Log Message: Fix [ 782709 ] not match between actual score and what's shown in outlook on the Outlook dialog branch. Index: msgstore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v retrieving revision 1.61 retrieving revision 1.61.2.1 diff -C2 -d -r1.61 -r1.61.2.1 *** msgstore.py 31 Jul 2003 12:30:00 -0000 1.61 --- msgstore.py 8 Aug 2003 02:54:34 -0000 1.61.2.1 *************** *** 348,352 **** return "".join(chunks) except pythoncom.com_error, d: ! print "Error getting property from stream", d return "" --- 348,353 ---- return "".join(chunks) except pythoncom.com_error, d: ! print "Error getting property", mapiutil.GetPropTagName(prop_id), \ ! "from stream:", d return "" *************** *** 507,510 **** --- 508,518 ---- # prop_row is a single mapi property row, with fields as above. + # NOTE: We can't trust these properties for "large" values + # (ie, strings, PT_BINARY, objects etc.), as they sometimes come + # from the IMAPITable (which has a 255 limit on property values) + # and sometimes from the object itself (which has no restriction). + # This limitation is documented by MAPI. + # Thus, we don't trust "PR_TRANSPORT_MESSAGE_HEADERS_A" more than + # to ask "does the property exist?" tag, eid = prop_row[0] # ID tag, store_eid = prop_row[1] *************** *** 520,533 **** self.msgclass = msgclass self.subject = subject ! if PROP_TYPE(headers_tag)==PT_STRING8: ! self.headers = headers ! has_headers = True ! else: ! # headers probably too big for simple property fetch - this is ! # the case if we got back MAPI_E_NOT_ENOUGH_MEMORY ! # (but don't bother fetching the header yet) ! has_headers = PROP_TYPE(headers_tag)==PT_ERROR and \ ! headers==mapi.MAPI_E_NOT_ENOUGH_MEMORY ! self.headers = None # Search key is the only reliable thing after a move/copy operation # only problem is that it can potentially be changed - however, the --- 528,532 ---- self.msgclass = msgclass self.subject = subject ! has_headers = PROP_TYPE(headers_tag)==PT_STRING8 # Search key is the only reliable thing after a move/copy operation # only problem is that it can potentially be changed - however, the *************** *** 601,617 **** self._EnsureObject() - if self.headers is None: # they were too large when created! - prop_ids = (PR_TRANSPORT_MESSAGE_HEADERS_A,) - hr, data = self.mapi_object.GetProps(prop_ids,0) - self.headers = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0]) - headers = self.headers - prop_ids = (PR_BODY_A, MYPR_BODY_HTML_A, ! PR_HASATTACH) hr, data = self.mapi_object.GetProps(prop_ids,0) body = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0]) html = self._GetPotentiallyLargeStringProp(prop_ids[1], data[1]) has_attach = data[2][1] # Some Outlooks deliver a strange notion of headers, including --- 600,612 ---- self._EnsureObject() prop_ids = (PR_BODY_A, MYPR_BODY_HTML_A, ! PR_HASATTACH, ! PR_TRANSPORT_MESSAGE_HEADERS_A) hr, data = self.mapi_object.GetProps(prop_ids,0) body = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0]) html = self._GetPotentiallyLargeStringProp(prop_ids[1], data[1]) has_attach = data[2][1] + headers = self._GetPotentiallyLargeStringProp(prop_ids[3], data[3]) # Some Outlooks deliver a strange notion of headers, including From mhammond at users.sourceforge.net Thu Aug 7 23:10:33 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 8 01:10:39 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/installer installation_notes.rtf, NONE, 1.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/installer In directory sc8-pr-cvs1:/tmp/cvs-serv14474 Added Files: installation_notes.rtf Log Message: A little RTF file (maintained by Windows 'WordPad') displayed near the start of the installation. Tells users to shutdown Anti-Virus, and to be careful if Word is the email editor. --- NEW FILE: installation_notes.rtf --- {\rtf1\ansi\ansicpg1252\deff0\deflang3081{\fonttbl{\f0\fswiss\fcharset0 Arial;}} \viewkind4\uc1\pard\b\f0\fs22 Virus Scanners\par \b0 If you are running any Anti-Virus software in \i real-time\i0 mode (particularly McAfee), please disable it before installing. Note that as this installer is already running, it has already been certified virus-free by any such programs - so this should be a safe thing to do for the duration of the install.\par \b\par Word as Email Editor\par \b0 If you have Outlook configured to use Microsoft Word as your email editor, you must ensure Word is closed before proceeding. Unfortunately, just because you can not see a Word window does not mean it is running. If you do use Word as your editor, it is recommended you restart Windows, and restart this installation before starting Outlook for the first time.\b\par \par } From mhammond at users.sourceforge.net Thu Aug 7 23:13:10 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 8 01:13:13 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/installer spambayes_addin.iss, 1.6, 1.7 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/installer In directory sc8-pr-cvs1:/tmp/cvs-serv15021 Modified Files: spambayes_addin.iss Log Message: Display some installation notes, and tell the user trying to shutdown Outlook that Outlook can be a pig (well, in not those words!) Index: spambayes_addin.iss =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/installer/spambayes_addin.iss,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** spambayes_addin.iss 28 Jul 2003 14:05:59 -0000 1.6 --- spambayes_addin.iss 8 Aug 2003 05:13:08 -0000 1.7 *************** *** 11,15 **** OutputDir=. OutputBaseFilename=SpamBayes-Outlook-Setup ! [Files] Source: "dist\spambayes_addin.dll"; DestDir: "{app}"; Flags: ignoreversion regserver --- 11,18 ---- OutputDir=. OutputBaseFilename=SpamBayes-Outlook-Setup ! ; Note the check for Outlook running has already been done, so no point ! ; having this file tell them to shutdown outlook! ! ; Edit file using Windows 'wordpad' ! InfoBeforeFile=installation_notes.rtf [Files] Source: "dist\spambayes_addin.dll"; DestDir: "{app}"; Flags: ignoreversion regserver *************** *** 39,44 **** Result := MsgBox( 'You must close Outlook before SpamBayes can be installed.' + #13 + #13 + ! 'Please close all Outlook Windows and click Retry' + #13 + ! 'or click Cancel to exit the installation.', mbConfirmation, MB_RETRYCANCEL) = idRetry; end; --- 42,49 ---- Result := MsgBox( 'You must close Outlook before SpamBayes can be installed.' + #13 + #13 + ! 'Please close all Outlook Windows (using "File->Exit and Log off"' + #13 + ! 'if available) and click Retry, or click Cancel to exit the installation.'+ #13 + #13 + ! 'If this message persists after closing all Outlook windows, you may' + #13 + ! 'need to log off from Windows, and try again.', mbConfirmation, MB_RETRYCANCEL) = idRetry; end; From mhammond at users.sourceforge.net Fri Aug 8 00:45:49 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 8 02:45:52 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.87,1.88 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv27218 Modified Files: addin.py Log Message: Fix bug [ 784323 ] Plug-in will not intialize/watch in offline mode by not treating failure to create the 'Spam' field in the Outlook folder as fatal. I'm sure it used to not be fatal once, and is again now :) Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** addin.py 6 Aug 2003 06:56:21 -0000 1.87 --- addin.py 8 Aug 2003 06:45:47 -0000 1.88 *************** *** 1154,1158 **** new_hook.Init(msgstore_folder, self.application, self.manager) new_hooks[msgstore_folder.id] = new_hook ! self.manager.EnsureOutlookFieldsForFolder(msgstore_folder.GetID()) print "SpamBayes: Watching for new messages in folder ", name else: --- 1154,1169 ---- new_hook.Init(msgstore_folder, self.application, self.manager) new_hooks[msgstore_folder.id] = new_hook ! try: ! self.manager.EnsureOutlookFieldsForFolder(msgstore_folder.GetID()) ! except: ! # An exception checking that Outlook's folder has a ! # 'spam' field is not fatal, nor really even worth ! # telling the user about, nor even worth a traceback ! # (as it is likely a COM error). ! print "ERROR: Failed to check folder '%s' for " \ ! "Spam field" % name ! etype, value, tb = sys.exc_info() ! tb = None # dont want it, and nuke circular ref ! traceback.print_exception(etype, value, tb) print "SpamBayes: Watching for new messages in folder ", name else: *************** *** 1209,1216 **** pass ! def RegisterAddin(klass): ! # prints to help debug binary install issues. import _winreg ! key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Office\\Outlook\\Addins") subkey = _winreg.CreateKey(key, klass._reg_progid_) --- 1220,1226 ---- pass ! def _DoRegister(klass, root): import _winreg ! key = _winreg.CreateKey(root, "Software\\Microsoft\\Office\\Outlook\\Addins") subkey = _winreg.CreateKey(key, klass._reg_progid_) *************** *** 1219,1226 **** --- 1229,1259 ---- _winreg.SetValueEx(subkey, "Description", 0, _winreg.REG_SZ, "SpamBayes anti-spam tool") _winreg.SetValueEx(subkey, "FriendlyName", 0, _winreg.REG_SZ, "SpamBayes") + + def RegisterAddin(klass): + import _winreg + # Try and register twice - once in HKLM, and once in HKCU. This seems + # to help roaming profiles, etc. Once registered, it is both registered + # on this machine for the current user (even when they roam, assuming it + # has been installed on the remote machine also) and for any user on this + # machine. + try: + _DoRegister(klass, _winreg.HKEY_LOCAL_MACHINE) + except WindowsError: + # But they may not have the rights to install there. + pass + # We don't catch exception registering just for this user though + # that is fatal! + _DoRegister(klass, _winreg.HKEY_CURRENT_USER) print "Registration complete." def UnregisterAddin(klass): import _winreg + try: + _winreg.DeleteKey(_winreg.HKEY_LOCAL_MACHINE, + "Software\\Microsoft\\Office\\Outlook\\Addins\\" \ + + klass._reg_progid_) + except WindowsError: + pass + # and again for current user. try: _winreg.DeleteKey(_winreg.HKEY_CURRENT_USER, From mhammond at users.sourceforge.net Fri Aug 8 11:10:44 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 8 13:10:47 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 tester.py,1.11,1.12 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv28714 Modified Files: tester.py Log Message: Demonstrate [ 780612 ] Outlook incorrectly trains on moved messages Index: tester.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/tester.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tester.py 30 Jul 2003 03:21:21 -0000 1.11 --- tester.py 8 Aug 2003 17:10:42 -0000 1.12 *************** *** 106,115 **** # The "watch" folder is a folder we can stick stuff into to have them # filtered - just use the first one nominated. ! for folder in mgr.message_store.GetFolderGenerator( mgr.config.filter.watch_folder_ids, ! mgr.config.filter.watch_include_sub): ! self.folder_watch = folder.GetOutlookItem() ! break ! # And the drafts folder where new messages are created. self.folder_drafts = mgr.outlook.Session.GetDefaultFolder(constants.olFolderDrafts) --- 106,120 ---- # The "watch" folder is a folder we can stick stuff into to have them # filtered - just use the first one nominated. ! self.folder_watch = self.folder_watch_2 = None ! gen = mgr.message_store.GetFolderGenerator( mgr.config.filter.watch_folder_ids, ! mgr.config.filter.watch_include_sub) ! try: ! self.folder_watch = gen.next().GetOutlookItem() ! self.folder_watch_2 = gen.next().GetOutlookItem() ! except StopIteration: ! pass ! if self.folder_watch is None: ! raise RuntimeError, "Can't test without at least one folder to watch" # And the drafts folder where new messages are created. self.folder_drafts = mgr.outlook.Session.GetDefaultFolder(constants.olFolderDrafts) *************** *** 283,295 **** print "Created a Spam message, and saw it get filtered and trained." ! def TestHamFilter(driver): # Create a ham message in the Inbox - it should not get filtered ! msg, words = driver.CreateTestMessageInFolder(HAM, driver.folder_watch) # sleep to ensure filtering. WaitForFilters() # It should still be in the Inbox. ! if driver.FindTestMessage(driver.folder_watch) is None: TestFailed("The test ham message appeared to have been filtered!") msg.Delete() print "Created a Ham message, and saw it remain in place." --- 288,340 ---- print "Created a Spam message, and saw it get filtered and trained." ! def _DoTestHamTrain(driver, folder1, folder2): ! # [ 780612 ] Outlook incorrectly trains on moved messages ! # Should not train when previously classified message is moved by the user ! # from one watch folder to another. ! nham = driver.manager.bayes.nham ! nspam = driver.manager.bayes.nspam ! ! # Create a ham message in the Inbox - it wont get filtered if the other ! # tests pass, but we do need to wait for it to be scored. ! msg, words = driver.CreateTestMessageInFolder(HAM, folder1) ! # sleep to ensure filtering. ! WaitForFilters() ! # It should still be in the Inbox. ! if driver.FindTestMessage(folder1) is None: ! TestFailed("The test ham message appeared to have been filtered!") ! ! # Manually move it to folder2 ! msg.Move(folder2) ! # re-find it in folder2 ! msg = driver.FindTestMessage(folder2) ! ! # sleep to any processing in this folder. ! WaitForFilters() ! ! if nspam != driver.manager.bayes.nspam or nham != driver.manager.bayes.nham: ! TestFailed("Move of existing ham caused a train") ! msg.Delete() ! ! def _DoTestHamFilter(driver, folder): # Create a ham message in the Inbox - it should not get filtered ! msg, words = driver.CreateTestMessageInFolder(HAM, folder) # sleep to ensure filtering. WaitForFilters() # It should still be in the Inbox. ! if driver.FindTestMessage(folder) is None: TestFailed("The test ham message appeared to have been filtered!") msg.Delete() + + def TestHamFilter(driver): + _DoTestHamFilter(driver, driver.folder_watch) + # Try again, with the secondary folder if it exists (it is likely one + # is the inbox and one isn't, so may be useful) + if driver.folder_watch_2 is not None: + _DoTestHamFilter(driver, driver.folder_watch_2) + # Now test our incremental train logic + _DoTestHamTrain(driver, driver.folder_watch, driver.folder_watch_2) + else: + print "Skipping testing secondary watch folder filtering - " \ + "only one watch folder is configured" print "Created a Ham message, and saw it remain in place." From mhammond at users.sourceforge.net Fri Aug 8 11:11:20 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 8 13:11:23 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.88,1.89 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv28837 Modified Files: addin.py Log Message: Fix [ 780612 ] Outlook incorrectly trains on moves messages. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** addin.py 8 Aug 2003 06:45:47 -0000 1.88 --- addin.py 8 Aug 2003 17:11:18 -0000 1.89 *************** *** 197,209 **** # otherwise just ignore. if manager.config.training.train_recovered_spam: - subject = msgstore_message.GetSubject() import train ! print "Training on message '%s' - " % subject, ! if train.train_message(msgstore_message, False, manager, rescore = True): ! print "trained as good" else: ! print "already was trained as good" ! assert train.been_trained_as_ham(msgstore_message, manager) ! manager.SaveBayesPostIncrementalTrain() return if manager.config.filter.enabled: --- 197,226 ---- # otherwise just ignore. if manager.config.training.train_recovered_spam: import train ! if train.been_trained_as_spam(msgstore_message, manager): ! need_train = True else: ! prop = msgstore_message.GetField(manager.config.general.field_score_name) ! # We may not have been able to save the score - re-score now ! if prop is None: ! prop = manager.score(msgstore_message) ! # If it was not previously classified as either 'Spam' or ! # 'Unsure', then this event is unlikely to be the user ! # re-classifying (and in fact it may simply be the Outlook ! # rules moving the item. ! need_train = manager.config.filter.unsure_threshold < prop * 100 ! ! subject = msgstore_message.subject ! if need_train: ! print "Training on message '%s' - " % subject, ! if train.train_message(msgstore_message, False, manager, rescore = True): ! print "trained as good" ! else: ! print "already was trained as good" ! assert train.been_trained_as_ham(msgstore_message, manager) ! manager.SaveBayesPostIncrementalTrain() ! else: ! manager.LogDebug(1, "Message '%s' was previously been seen, but " \ ! "did not need to be trained as ham" % subject) return if manager.config.filter.enabled: *************** *** 548,552 **** traceback.print_exc() print "Tests FAILED. Sorry about that. If I were you, I would do a full re-train ASAP" ! print "Please delete any test messages from your Spam, Unsure or Inbox folders first." # The "Delete As Spam" and "Recover Spam" button --- 565,569 ---- traceback.print_exc() print "Tests FAILED. Sorry about that. If I were you, I would do a full re-train ASAP" ! print "Please delete any test messages from your Spam, Unsure or Inbox/Watch folders first." # The "Delete As Spam" and "Recover Spam" button From mhammond at users.sourceforge.net Fri Aug 8 11:13:20 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 8 13:13:23 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.89,1.90 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv29142 Modified Files: addin.py Log Message: Typo in log message. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** addin.py 8 Aug 2003 17:11:18 -0000 1.89 --- addin.py 8 Aug 2003 17:13:18 -0000 1.90 *************** *** 221,225 **** manager.SaveBayesPostIncrementalTrain() else: ! manager.LogDebug(1, "Message '%s' was previously been seen, but " \ "did not need to be trained as ham" % subject) return --- 221,225 ---- manager.SaveBayesPostIncrementalTrain() else: ! manager.LogDebug(1, "Message '%s' was previously seen, but " \ "did not need to be trained as ham" % subject) return From xenogeist at users.sourceforge.net Fri Aug 8 16:45:12 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Fri Aug 8 18:45:15 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.1.2.3, 1.1.2.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv19492/Outlook2000/dialogs/resources Modified Files: Tag: outlook-dialog-branch dialogs.rc Log Message: Use the "Tahoma" font which is used by the rest of the Outlook (and Office) UI since around 1998. Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/dialogs.rc,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** dialogs.rc 5 Aug 2003 08:16:16 -0000 1.1.2.3 --- dialogs.rc 8 Aug 2003 22:45:10 -0000 1.1.2.4 *************** *** 32,36 **** EXSTYLE WS_EX_CONTEXTHELP CAPTION "SpamBayes" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN CONTROL "SpamBayes version xxx",IDC_VERSION,"Static", --- 32,36 ---- EXSTYLE WS_EX_CONTEXTHELP CAPTION "SpamBayes" ! FONT 8, "Tahoma", 0, 0, 0x1 BEGIN CONTROL "SpamBayes version xxx",IDC_VERSION,"Static", *************** *** 70,74 **** EXSTYLE WS_EX_CONTEXTHELP CAPTION "Training" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Folders with known good messages.",IDC_STATIC,7,6,131, --- 70,74 ---- EXSTYLE WS_EX_CONTEXTHELP CAPTION "Training" ! FONT 8, "Tahoma", 0, 0, 0x1 BEGIN LTEXT "Folders with known good messages.",IDC_STATIC,7,6,131, *************** *** 97,101 **** EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Now" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Filter the following folders",IDC_STATIC,8,9,168,11 --- 97,101 ---- EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Now" ! FONT 8, "Tahoma", 0, 0, 0x1 BEGIN LTEXT "Filter the following folders",IDC_STATIC,8,9,168,11 *************** *** 126,130 **** EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Rules" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Filter the following folders as messages arrive", --- 126,130 ---- EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Rules" ! FONT 8, "Tahoma", 0, 0, 0x1 BEGIN LTEXT "Filter the following folders as messages arrive", *************** *** 172,176 **** STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Dialog" ! FONT 8, "MS Sans Serif" BEGIN LTEXT "&Folders:",IDC_STATIC,7,7,47,9 --- 172,176 ---- STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Dialog" ! FONT 8, "Tahoma" BEGIN LTEXT "&Folders:",IDC_STATIC,7,7,47,9 From xenogeist at users.sourceforge.net Fri Aug 8 17:05:54 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Fri Aug 8 19:06:27 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.86.2.2, 1.86.2.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv22560/Outlook2000 Modified Files: Tag: outlook-dialog-branch addin.py Log Message: Added website links to the help menu. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.86.2.2 retrieving revision 1.86.2.3 diff -C2 -d -r1.86.2.2 -r1.86.2.3 *** addin.py 6 Aug 2003 02:15:53 -0000 1.86.2.2 --- addin.py 8 Aug 2003 23:05:52 -0000 1.86.2.3 *************** *** 415,418 **** --- 415,427 ---- mgr.ShowHtml("about.html") + def ShowSpamBayesWebsite(mgr): + os.startfile("http://spambayes.sourceforge.net/") + def ShowFAQ(mgr): + os.startfile("http://spambayes.sourceforge.net/faq.html") + def ShowFAQ(mgr): + os.startfile("http://spambayes.sourceforge.net/faq.html") + def ShowBugTracker(mgr): + os.startfile("http://sourceforge.net/tracker/?group_id=61702&atid=498103") + def ShowTroubleshooting(mgr): mgr.ShowHtml("docs/troubleshooting.html") *************** *** 808,811 **** --- 817,841 ---- Visible=True, Tag = "SpamBayesCommand.Help.ShowTroubleshooting") + self._AddControl(helpPopup, + constants.msoControlButton, + ButtonEvent, (ShowSpamBayesWebsite, self.manager,), + Caption="SpamBayes Website", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.Help.ShowSpamBayes Website") + self._AddControl(helpPopup, + constants.msoControlButton, + ButtonEvent, (ShowFAQ, self.manager,), + Caption="Frequently Asked Questions", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.Help.ShowFAQ") + self._AddControl(helpPopup, + constants.msoControlButton, + ButtonEvent, (ShowBugTracker, self.manager,), + Caption="SpamBayes Bug Tracker", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.Help.BugTacker") # If we are running from Python sources, enable a few extra items if not hasattr(sys, "frozen"): From xenogeist at users.sourceforge.net Fri Aug 8 21:08:11 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Fri Aug 8 23:08:14 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rcparser.py, 1.1.2.4, 1.1.2.5 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv17793/Outlook2000/dialogs/resources Modified Files: Tag: outlook-dialog-branch rcparser.py Log Message: Remove test function. No need to bloat the binary by import mfc stuff when the rest of the plugin doesn't use it in the branch. Index: rcparser.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/rcparser.py,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** rcparser.py 5 Aug 2003 17:36:52 -0000 1.1.2.4 --- rcparser.py 9 Aug 2003 03:08:09 -0000 1.1.2.5 *************** *** 285,298 **** rcp.loadDialogs(rc_file) return rcp - - def test(): - from pywin.mfc import dialog - rcp = ParseDialogs("dialogs.rc") - for idName in rcp.dialogs: - dlg = dialog.Dialog(rcp.dialogs[idName].createDialogTemplate()) - dlg.DoModal() - return rcp - - if __name__=='__main__': - test() - --- 285,286 ---- From mhammond at users.sourceforge.net Fri Aug 8 21:26:18 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 8 23:26:21 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/installer spambayes_addin.iss, 1.7, 1.8 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/installer In directory sc8-pr-cvs1:/tmp/cvs-serv20410 Modified Files: spambayes_addin.iss Log Message: Binary Version 007 Index: spambayes_addin.iss =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/installer/spambayes_addin.iss,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** spambayes_addin.iss 8 Aug 2003 05:13:08 -0000 1.7 --- spambayes_addin.iss 9 Aug 2003 03:26:16 -0000 1.8 *************** *** 5,10 **** [Setup] AppName=Spambayes Outlook Addin ! AppVerName=Spambayes Outlook Addin 0.6 ! AppVersion=0.6 DefaultDirName={pf}\Spambayes Outlook Addin DefaultGroupName=Spambayes Outlook Addin --- 5,10 ---- [Setup] AppName=Spambayes Outlook Addin ! AppVerName=Spambayes Outlook Addin 0.7 ! AppVersion=0.7 DefaultDirName={pf}\Spambayes Outlook Addin DefaultGroupName=Spambayes Outlook Addin From mhammond at users.sourceforge.net Fri Aug 8 21:26:56 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 8 23:26:59 2003 Subject: [Spambayes-checkins] spambayes/spambayes Version.py,1.13,1.14 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv20502 Modified Files: Version.py Log Message: Outlook binary version 7. Index: Version.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Version.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Version.py 29 Jul 2003 06:32:48 -0000 1.13 --- Version.py 9 Aug 2003 03:26:54 -0000 1.14 *************** *** 31,38 **** }, "Outlook" : { ! "Version": 0.6, ! "BinaryVersion": 0.6, ! "Description": "SpamBayes Outlook Addin (beta)", ! "Date": "July 29, 2003", "Full Description": "%(Description)s, version %(Version)s (%(Date)s)", "Full Description Binary": --- 31,38 ---- }, "Outlook" : { ! "Version": 0.7, ! "BinaryVersion": 0.7, ! "Description": "SpamBayes Outlook Addin", ! "Date": "August 9, 2003", "Full Description": "%(Description)s, version %(Version)s (%(Date)s)", "Full Description Binary": From xenogeist at users.sourceforge.net Fri Aug 8 22:38:29 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sat Aug 9 00:38:34 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dlgcore.py, 1.1.2.7, 1.1.2.8 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv31059/Outlook2000/dialogs Modified Files: Tag: outlook-dialog-branch dlgcore.py Log Message: added a utility to generate a py file from an rc file. Not sure how to put this in the binary build process. Changed the dialogs member of rcparser to the dialog tuples. The tuples are created when reading the rc file now instead of requiring a seperate function call. Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/Attic/dlgcore.py,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** dlgcore.py 5 Aug 2003 12:06:00 -0000 1.1.2.7 --- dlgcore.py 9 Aug 2003 04:38:27 -0000 1.1.2.8 *************** *** 77,82 **** self.parent = parent self.dialog_parser = parser ! self.dialog_def = parser.dialogs[idd] ! self.template = self.dialog_def.createDialogTemplate() def _GetIDName(self, cid): --- 77,81 ---- self.parent = parent self.dialog_parser = parser ! self.template = parser.dialogs[idd] def _GetIDName(self, cid): From xenogeist at users.sourceforge.net Fri Aug 8 22:38:29 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sat Aug 9 00:38:36 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rc2py.py, NONE, 1.1.2.1 rcparser.py, 1.1.2.5, 1.1.2.6 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv31059/Outlook2000/dialogs/resources Modified Files: Tag: outlook-dialog-branch rcparser.py Added Files: Tag: outlook-dialog-branch rc2py.py Log Message: added a utility to generate a py file from an rc file. Not sure how to put this in the binary build process. Changed the dialogs member of rcparser to the dialog tuples. The tuples are created when reading the rc file now instead of requiring a seperate function call. --- NEW FILE: rc2py.py --- # rc2py.py __author__="Adam Walker" __doc__="""" Converts an .rc windows resource source file into a python source file with the same basic public interface as the rcparser module. """ import sys, os import rcparser def convert(inputFilename = None, outputFilename = None): """See the module doc string""" if inputFilename is None: inputFilename = "dialogs.rc" if outputFilename is None: outputFilename = "test.py" rcp = rcparser.ParseDialogs(inputFilename) out = open("test.py", "wt") out.write("#%s\n" % outputFilename) out.write("#This is a generated file. Please edit %s instead.\n" % inputFilename) out.write("class FakeParser(object):\n") out.write("\tdialogs = "+repr(rcp.dialogs)+"\n") out.write("\tids = "+repr(rcp.ids)+"\n") out.write("\tnames = "+repr(rcp.names)+"\n") out.write("def ParseDialogs(s):\n") out.write("\treturn FakeParser()\n") out.close() if __name__=="__main__": if len(sys.argv)>1: convert(sys.argv[1], sys.argv[2]) else: convert() Index: rcparser.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/Attic/rcparser.py,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** rcparser.py 9 Aug 2003 03:08:09 -0000 1.1.2.5 --- rcparser.py 9 Aug 2003 04:38:27 -0000 1.1.2.6 *************** *** 96,99 **** --- 96,100 ---- next_id = 1001 dialogs = {} + _dialogs = {} debugEnabled = False; token = "" *************** *** 157,161 **** dlg = DialogDef(name,self.addId(name)) assert len(dlg.controls)==0 ! self.dialogs[name] = dlg extras = [] self.getToken() --- 158,162 ---- dlg = DialogDef(name,self.addId(name)) assert len(dlg.controls)==0 ! self._dialogs[name] = dlg extras = [] self.getToken() *************** *** 188,191 **** --- 189,193 ---- else: break + self.dialogs[name] = dlg.createDialogTemplate() def dialogStyle(self, dlg): From mhammond at users.sourceforge.net Fri Aug 8 22:54:35 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sat Aug 9 00:54:39 2003 Subject: [Spambayes-checkins] website applications.ht, 1.16, 1.17 download.ht, 1.13, 1.14 windows.ht, 1.23, 1.24 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv496 Modified Files: applications.ht download.ht windows.ht Log Message: Version 007 of the Outlook plugin. Index: applications.ht =================================================================== RCS file: /cvsroot/spambayes/website/applications.ht,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** applications.ht 29 Jul 2003 02:08:39 -0000 1.16 --- applications.ht 9 Aug 2003 04:54:33 -0000 1.17 *************** *** 27,33 ****

    Availability

    !

    Mark has packaged together an installer for the plugin. You can download it from his website. ! This is currently at version 006.

    Download the alpha4 release.

    Alternatively, you can use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

    --- 27,33 ----

    Availability

    !

    Mark has packaged together an installer for the plugin. You can download it from his website. ! This is currently at version 007.

    Download the alpha4 release.

    Alternatively, you can use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

    Index: download.ht =================================================================== RCS file: /cvsroot/spambayes/website/download.ht,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** download.ht 29 Jul 2003 02:08:39 -0000 1.13 --- download.ht 9 Aug 2003 04:54:33 -0000 1.14 *************** *** 23,29 ****

    Binary Releases

    Outlook Plugin

    !

    Mark has packaged together an installer for the plugin. You can download it from his website. ! This is currently at version 006.

    Other

    --- 23,29 ----

    Binary Releases

    Outlook Plugin

    !

    Mark has packaged together an installer for the plugin. You can download it from his website. ! This is currently at version 007.

    Other

    Index: windows.ht =================================================================== RCS file: /cvsroot/spambayes/website/windows.ht,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** windows.ht 29 Jul 2003 02:08:39 -0000 1.23 --- windows.ht 9 Aug 2003 04:54:33 -0000 1.24 *************** *** 9,16 ****

    If you are using Outlook 2000 or Outlook XP (not Outlook Express) you should be able to simply download and run the Outlook plug-in installer. A separate Python installation is not necessary.

    !

    Note that all users who installed version 002 of the plugin are recommended to upgrade to the 006 release.

    The Outlook add-in was developed mostly using Outlook 2000 on Windows --- 9,17 ----

    If you are using Outlook 2000 or Outlook XP (not Outlook Express) you should be able to simply download and run the Outlook plug-in installer. A separate Python installation is not necessary.

    !

    Note that all users who installed version 006 or earlier of the plugin are ! recommended to upgrade to the 007 release.

    The Outlook add-in was developed mostly using Outlook 2000 on Windows From mhammond at users.sourceforge.net Sat Aug 9 19:15:22 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sat Aug 9 21:15:26 2003 Subject: [Spambayes-checkins] website quotes.ht,NONE,1.1 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv18192 Added Files: quotes.ht Log Message: Keep track of all quotable quotes. --- NEW FILE: quotes.ht --- Title: SpamBayes: Bayesian anti-spam classifier written in Python. Author-Email: SpamBayes@python.org Author: SpamBayes

    What people are saying about us

    Thanks to this remarkable open source duo, I am ready to declare victory on spam.
    Jon Udell, May 2003, in his weblog,

    Results, for me, were immediate and spectacular. SpamBayes nailed a number of spams that SpamAssassin let through
    Jon Udell again, in a two page InfoWorld article

    And efficient it is. After a just bit of training, the SpamBayes Outlook Addin detects junk mail reliably.
    Review by Heinz Tschabitscher at email.about.com

    Probably the best plug-in for Outlook out there.
    Review by arstechnica.com

    If you're an Outlook user, free SpamBayes does a more effective job than a number of filtering programs you have to pay for
    Review at soundingline.com

    What we are saying about us

    OK, maybe quotes from the SpamBayes developers aren't quite as objective, but they are amusing!

    The performance on my real-life email is nothing short of amazing! ...I didn't realize it before, but this stuff is cool <wink>
    Tim Peters as he tries a very early Outlook addin on his personal mail

    So, anyone who runs windows and Outlook feel like taking this on?
    Innocent words from Anthony Baxter goading Mark Hammond into building an Outlook addin

    I followed up too :) I have a working Outlook Addin in place.
    Mark Hammod uttering words he is likely to regret for years to come

    From mhammond at users.sourceforge.net Sat Aug 9 19:15:50 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sat Aug 9 21:15:53 2003 Subject: [Spambayes-checkins] website index.ht,1.18,1.19 links.h,1.10,1.11 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv18222 Modified Files: index.ht links.h Log Message: Add links to the new quotes page. Index: index.ht =================================================================== RCS file: /cvsroot/spambayes/website/index.ht,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** index.ht 4 Aug 2003 01:50:26 -0000 1.18 --- index.ht 10 Aug 2003 01:15:48 -0000 1.19 *************** *** 5,9 ****

    News

    !

    Fourth pre-release available. See the download page for more.

    What is SpamBayes?

    --- 5,10 ----

    News

    !

    Fourth pre-release and Outlook plugin available. See the download page for more.

    !

    You may also like to see what other people have been saying about us in the press and elsewhere.

    What is SpamBayes?

    Index: links.h =================================================================== RCS file: /cvsroot/spambayes/website/links.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** links.h 7 Aug 2003 06:23:51 -0000 1.10 --- links.h 10 Aug 2003 01:15:48 -0000 1.11 *************** *** 4,7 **** --- 4,8 ----
  • Documentation
  • Applications +
  • Reviews/Quotes
  • Developers
  • Related From mhammond at users.sourceforge.net Sun Aug 10 01:06:14 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 03:06:18 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/installer crank.py, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/installer In directory sc8-pr-cvs1:/tmp/cvs-serv20277 Modified Files: crank.py Log Message: Needs an absolute path. Index: crank.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/installer/crank.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crank.py 29 Jul 2003 01:18:58 -0000 1.1 --- crank.py 10 Aug 2003 07:06:12 -0000 1.2 *************** *** 9,13 **** return 1 ! this_dir = os.path.dirname(__file__) if os.path.exists(os.path.join(this_dir, "buildspambayes_addin")): shutil.rmtree(os.path.join(this_dir, "buildspambayes_addin")) --- 9,13 ---- return 1 ! this_dir = os.path.abspath(os.path.dirname(__file__)) if os.path.exists(os.path.join(this_dir, "buildspambayes_addin")): shutil.rmtree(os.path.join(this_dir, "buildspambayes_addin")) From mhammond at users.sourceforge.net Sun Aug 10 01:26:51 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 03:26:56 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 about.html, 1.18, 1.19 addin.py, 1.90, 1.91 manager.py, 1.69, 1.70 train.py, 1.27, 1.28 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv22259 Modified Files: about.html addin.py manager.py train.py Log Message: Merge in outlook-dialog-branch. Thanks everyone. Index: about.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/about.html,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** about.html 4 Aug 2003 15:06:08 -0000 1.18 --- about.html 10 Aug 2003 07:26:48 -0000 1.19 *************** *** 99,111 **** system is also trained.  This makes it less likely that another similar mail will be incorrectly classified in the future.
    !

    Installing and Configuring the plugin

    If you download the installer version of this plugin (ie, you ! downloaded a .EXE file you use to install), then everthing is installed and just needs to be configured.  If you downloaded the sourcecode version of the plugin, please view README.txt for installation ! instructions.
    ! Configuring the plugin requires the following steps:
    --- 99,111 ---- system is also trained.  This makes it less likely that another similar mail will be incorrectly classified in the future.
    !

    Installing and Configuring the plugin

    If you download the installer version of this plugin (ie, you ! downloaded a .EXE file you use to install), then everything is installed and just needs to be configured.  If you downloaded the sourcecode version of the plugin, please view README.txt for installation ! instructions.
    ! Configuring the plugin requires the following steps:

    *************** *** 114,118 **** ') ! id_end = s.search(text[id_location:]).end() + id_location ! else: ! id_location += len(options["pop3proxy", ! "mailid_header_name"]) + 2 ! s = re.compile('[\w -]+[\\r]?\\n') ! id_end = s.search(text[id_location:]).end() + id_location ! id = text[id_location:id_end] ! s = re.compile('') ! if s.search(id) is not None: ! id = s.split(id)[0] ! s = re.compile('[\\r]?\\n') ! if s.search(id) is not None: ! id = s.split(id)[0] ! return id def train(self, msg, isSpam): ! id = self.extractSpambayesID(msg) if id is None: ! print "Could not extract id" ! return ! if options["globals", "verbose"]: ! if isSpam == True: ! print "Training %s as spam" % id ! else: ! print "Training %s as ham" % id ! if self.state.unknownCorpus.get(id) is not None: ! sourceCorpus = self.state.unknownCorpus ! elif self.state.hamCorpus.get(id) is not None: ! sourceCorpus = self.state.hamCorpus ! elif self.state.spamCorpus.get(id) is not None: ! sourceCorpus = self.state.spamCorpus else: ! # message doesn't exist in any corpus ! print "Non-existant message" ! return if isSpam == True: targetCorpus = self.state.spamCorpus --- 414,478 ---- return None + header_pattern = re.escape(options["Headers", "mailid_header_name"]) + # A MUA might enclose the id in a table, thus the convoluted re pattern + # (Mozilla Mail does this with inline html) + header_pattern += r":\s*(\\s*\\s*)?([\d\-]+)" + header_re = re.compile(header_pattern) + def _find_id_in_text(self, text): ! mo = self.header_re.search(text) ! if mo is None: return None ! return mo.group(2) def train(self, msg, isSpam): ! try: ! use_cached = options["smtpproxy", "use_cached_message"] ! except KeyError: ! use_cached = True ! if use_cached: ! id = self.extractSpambayesID(msg) ! if id is None: ! print "Could not extract id" ! return ! self.train_cached_message(id, isSpam) ! # Otherwise, train on the forwarded/bounced message. ! msg = sbheadermessage_from_string(msg) ! id = msg.setIdFromPayload() ! msg.delSBHeaders() if id is None: ! # No id, so we don't have any reliable method of remembering ! # information about this message, so we just assume that it ! # hasn't been trained before. We could generate some sort of ! # checksum for the message and use that as an id (this would ! # mean that we didn't need to store the id with the message) ! # but that might be a little unreliable. ! self.classifier.learn(msg.asTokens(), isSpam) else: ! if msg.GetTrained() == (not isSpam): ! self.classifier.unlearn(msg.asTokens(), not isSpam) ! msg.RememberTrained(None) ! if msg.GetTrained() is None: ! self.classifier.learn(msg.asTokens(), isSpam) ! msg.RememberTrained(isSpam) ! ! def train_cached_message(self, id, isSpam): ! if not self.train_message_in_pop3proxy_cache(id, isSpam) and \ ! not self.train_message_on_imap_server(id, isSpam): ! print "Could not find message (%s); perhaps it was " + \ ! "deleted from the POP3Proxy cache or the IMAP " + \ ! "server." % (id, ) ! ! def train_message_in_pop3proxy_cache(self, id, isSpam): ! if self.state is None: ! return False ! sourceCorpus = None ! for corpus in [self.state.unknownCorpus, self.state.hamCorpus, ! self.state.spamCorpus]: ! if corpus.get(id) is not None: ! sourceCorpus = corpus ! break ! if corpus is None: ! return False if isSpam == True: targetCorpus = self.state.spamCorpus *************** *** 464,468 **** targetCorpus = self.state.hamCorpus targetCorpus.takeMessage(id, sourceCorpus) ! self.state.bayes.store() def LoadServerInfo(): --- 480,501 ---- targetCorpus = self.state.hamCorpus targetCorpus.takeMessage(id, sourceCorpus) ! self.classifier.store() ! ! def train_message_on_imap_server(self, id, isSpam): ! if self.imap is None: ! return False ! msg = self.imap.FindMessage(id) ! if msg is None: ! return False ! if msg.GetTrained() == (not isSpam): ! msg.get_substance() ! msg.delSBHeaders() ! self.classifier.unlearn(msg.asTokens(), not isSpam) ! msg.RememberTrained(None) ! if msg.GetTrained() is None: ! msg.get_substance() ! msg.delSBHeaders() ! self.classifier.learn(msg.asTokens(), isSpam) ! msg.RememberTrained(isSpam) def LoadServerInfo(): *************** *** 470,475 **** servers = [] proxyPorts = [] ! if options["smtpproxy", "servers"]: ! for server in options["smtpproxy", "servers"]: server = server.strip() if server.find(':') > -1: --- 503,508 ---- servers = [] proxyPorts = [] ! if options["smtpproxy", "remote_servers"]: ! for server in options["smtpproxy", "remote_servers"]: server = server.strip() if server.find(':') > -1: *************** *** 478,504 **** port = '25' servers.append((server, int(port))) ! if options["smtpproxy", "ports"]: ! splitPorts = options["smtpproxy", "ports"] proxyPorts = map(_addressAndPort, splitPorts) if len(servers) != len(proxyPorts): ! print "smtpproxy_servers & smtpproxy_ports are different lengths!" sys.exit() return servers, proxyPorts ! def CreateProxies(servers, proxyPorts, state): """Create BayesSMTPProxyListeners for all the given servers.""" for (server, serverPort), proxyPort in zip(servers, proxyPorts): ! listener = BayesSMTPProxyListener(server, serverPort, proxyPort, state) proxyListeners.append(listener) def main(): ! """Runs the proxy forever or until a 'KILL' command is received or ! someone hits Ctrl+Break.""" ! from pop3proxy import state servers, proxyPorts = LoadServerInfo() ! CreateProxies(servers, proxyPorts, state) Dibbler.run() if __name__ == '__main__': main() - \ No newline at end of file --- 511,576 ---- port = '25' servers.append((server, int(port))) ! if options["smtpproxy", "listen_ports"]: ! splitPorts = options["smtpproxy", "listen_ports"] proxyPorts = map(_addressAndPort, splitPorts) if len(servers) != len(proxyPorts): ! print "smtpproxy:remote_servers & smtpproxy:listen_ports are " + \ ! "different lengths!" sys.exit() return servers, proxyPorts ! def CreateProxies(servers, proxyPorts, trainer): """Create BayesSMTPProxyListeners for all the given servers.""" + # allow for old versions of pop3proxy + if not isinstance(trainer, SMTPTrainer): + trainer = SMTPTrainer(trainer.bayes, trainer) for (server, serverPort), proxyPort in zip(servers, proxyPorts): ! listener = BayesSMTPProxyListener(server, serverPort, proxyPort, ! trainer) proxyListeners.append(listener) def main(): ! """Runs the proxy until a 'KILL' command is received or someone hits ! Ctrl+Break.""" ! try: ! opts, args = getopt.getopt(sys.argv[1:], 'hvd:D:') ! except getopt.error, msg: ! print >>sys.stderr, str(msg) + '\n\n' + __doc__ ! sys.exit() ! ! bdbname = options["Storage", "persistent_storage_file"] ! useDBM = options["Storage", "persistent_use_database"] ! ! for opt, arg in opts: ! if opt == '-h': ! print >>sys.stderr, __doc__ ! sys.exit() ! elif opt == '-d': ! useDBM = False ! bdbname = arg ! elif opt == '-D': ! useDBM = True ! bdbname = arg ! elif opt == '-v': ! options["globals", "verbose"] = True ! ! bdbname = os.path.expanduser(bdbname) ! ! if options["globals", "verbose"]: ! print "Loading database %s..." % (bdbname), ! ! if useDBM: ! classifier = storage.DBDictClassifier(bdbname) ! else: ! classifier = storage.PickledClassifier(bdbname) ! ! if options["globals", "verbose"]: ! print "Done." ! servers, proxyPorts = LoadServerInfo() ! trainer = SMTPTrainer(classifier) ! CreateProxies(servers, proxyPorts, trainer) Dibbler.run() if __name__ == '__main__': main() From mhammond at users.sourceforge.net Sun Aug 24 22:19:39 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 00:19:42 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/sandbox mapi_driver.py, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/sandbox In directory sc8-pr-cvs1:/tmp/cvs-serv29265 Modified Files: mapi_driver.py Log Message: Fail when we can't find a default message store. Index: mapi_driver.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/sandbox/mapi_driver.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mapi_driver.py 28 Jul 2003 03:18:11 -0000 1.3 --- mapi_driver.py 25 Aug 2003 04:19:37 -0000 1.4 *************** *** 82,85 **** --- 82,87 ---- store_name = name.lower() break + else: + raise RuntimeError, "Can't find a default message store" folder_names = names else: From mhammond at users.sourceforge.net Sun Aug 24 22:21:09 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 00:21:13 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.65,1.66 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv29347 Modified Files: msgstore.py Log Message: GroupWise manages to change the message class for its virus reports. We now allow "IPM.Note" and "IPM.Anti-Virus*" Index: msgstore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** msgstore.py 25 Aug 2003 01:33:11 -0000 1.65 --- msgstore.py 25 Aug 2003 04:21:06 -0000 1.66 *************** *** 487,495 **** table = folder.GetContentsTable(0) if only_filter_candidates: ! # Limit ourselves to IPM.Note objects - ie, messages. restriction = (mapi.RES_PROPERTY, # a property restriction (mapi.RELOP_GE, # >= PR_MESSAGE_CLASS_A, # of the this prop ! (PR_MESSAGE_CLASS_A, "IPM.Note"))) # with this value table.Restrict(restriction, 0) table.SetColumns(MAPIMsgStoreMsg.message_init_props, 0) --- 487,495 ---- table = folder.GetContentsTable(0) if only_filter_candidates: ! # Limit ourselves to IPM.* objects - ie, messages. restriction = (mapi.RES_PROPERTY, # a property restriction (mapi.RELOP_GE, # >= PR_MESSAGE_CLASS_A, # of the this prop ! (PR_MESSAGE_CLASS_A, "IPM."))) # with this value table.Restrict(restriction, 0) table.SetColumns(MAPIMsgStoreMsg.message_init_props, 0) *************** *** 530,534 **** (mapi.RELOP_GE, # >= PR_MESSAGE_CLASS_A, # of the this prop ! (PR_MESSAGE_CLASS_A, "IPM.Note"))) # with this value # Put the final restriction together restriction = (mapi.RES_AND, (prop_restriction, --- 530,534 ---- (mapi.RELOP_GE, # >= PR_MESSAGE_CLASS_A, # of the this prop ! (PR_MESSAGE_CLASS_A, "IPM."))) # with this value # Put the final restriction together restriction = (mapi.RES_AND, (prop_restriction, *************** *** 655,660 **** # It does *not* exclude messages that were user composed, but still # actually received by the user (ie, when you mail yourself) ! return self.msgclass.lower().startswith("ipm.note") and \ ! (self.was_received or test_suite_running) def _GetPotentiallyLargeStringProp(self, prop_id, row): --- 655,670 ---- # It does *not* exclude messages that were user composed, but still # actually received by the user (ie, when you mail yourself) ! # GroupWise generates IPM.Anti-Virus.Report.45 (but I'm not sure how ! # it manages given it is an external server, and as far as I can tell, ! # this does not appear in the headers. ! class_check = self.msgclass.lower() ! for check in "ipm.note", "ipm.anti-virus": ! if class_check.startswith(check): ! break ! else: ! # Not matching class - no good ! return False ! # Must match msg class to get here. ! return self.was_received or test_suite_running def _GetPotentiallyLargeStringProp(self, prop_id, row): From mhammond at users.sourceforge.net Sun Aug 24 22:22:37 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 00:22:41 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 manager.py,1.77,1.78 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv29587 Modified Files: manager.py Log Message: Fix "Show Spam Clues" which I broke i my reorg. Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** manager.py 24 Aug 2003 23:51:32 -0000 1.77 --- manager.py 25 Aug 2003 04:22:35 -0000 1.78 *************** *** 696,700 **** def GetClassifier(self): """Return the classifier we're using.""" ! return self.bayes def SaveConfig(self): --- 696,700 ---- def GetClassifier(self): """Return the classifier we're using.""" ! return self.classifier_data.bayes def SaveConfig(self): From mhammond at users.sourceforge.net Sun Aug 24 22:23:18 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 00:23:23 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.21, 1.22 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv29749 Modified Files: dialog_map.py Log Message: Correct dialog ID that got spell-checked! Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** dialog_map.py 24 Aug 2003 14:08:03 -0000 1.21 --- dialog_map.py 25 Aug 2003 04:23:16 -0000 1.22 *************** *** 455,459 **** (MsSliderProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Experimental.timer_interval"), (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Experimental.timer_only_receive_folders"), ! (HiddenDialogCommand, "IDC_HIDDEN", "IDD_DIAGNOSIC"), ), "IDD_DIAGNOSTIC" : ( --- 455,459 ---- (MsSliderProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Experimental.timer_interval"), (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Experimental.timer_only_receive_folders"), ! (HiddenDialogCommand, "IDC_HIDDEN", "IDD_DIAGNOSTIC"), ), "IDD_DIAGNOSTIC" : ( From mhammond at users.sourceforge.net Sun Aug 24 23:33:26 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 01:33:29 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 manager.py,1.78,1.79 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv6154 Modified Files: manager.py Log Message: Fix [ 786952 ] Error when profile name has invalid filename characters Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** manager.py 25 Aug 2003 04:22:35 -0000 1.78 --- manager.py 25 Aug 2003 05:33:23 -0000 1.79 *************** *** 22,25 **** --- 22,32 ---- True, False = 1, 0 + # Characters valid in a filename. Used to nuke bad chars from the profile + # name (which we try and use as a filename). + # We assume characters > 127 are OK as they may be unicode + filename_chars = ('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + '0123456789' + """$%'-_@~ `!()^#&+,;=[]""") + # Report a message to the user - should only be used for pretty serious errors # hence we also print a traceback. *************** *** 608,611 **** --- 615,622 ---- profile_name = self.message_store.GetProfileName() + # The profile name may include characters invalid in file names. + if profile_name is not None: + profile_name = "".join([c for c in profile_name + if ord(c)>127 or c in filename_chars]) if profile_name is None: # should only happen in source-code versions - older win32alls can't From mhammond at users.sourceforge.net Mon Aug 25 00:30:29 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 02:30:33 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs FolderSelector.py, 1.23, 1.24 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv13198 Modified Files: FolderSelector.py Log Message: Fix [ 785389 ] Folders missing in Spambayes manager. A message store without a subtree would cause us to fail. Index: FolderSelector.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** FolderSelector.py 21 Aug 2003 07:03:36 -0000 1.23 --- FolderSelector.py 25 Aug 2003 06:30:27 -0000 1.24 *************** *** 116,119 **** --- 116,123 ---- mapi.MAPI_DEFERRED_ERRORS) hr, data = msgstore.GetProps((PR_IPM_SUBTREE_ENTRYID,)+ignore_ids, 0) + # It appears that not all stores have a subtree. + if PROP_TYPE(data[0][0]) != PT_BINARY: + print "FolderSelector dialog found message store without a subtree - ignoring" + continue subtree_eid = data[0][1] ignore_eids = [item[1] for item in data[1:] if PROP_TYPE(item[0])==PT_BINARY] From anadelonbrin at users.sourceforge.net Mon Aug 25 02:48:58 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Aug 25 04:49:02 2003 Subject: [Spambayes-checkins] spambayes/spambayes storage.py,1.18,1.19 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv1266/spambayes Modified Files: storage.py Log Message: Add a function that will return the appropriate storage object given the data source name. This means that pop3proxy, imapfilter, hammie et al can all use the same code to open up the storage object. Also add a bit to this function to hopefully preempt lots of people complaining because dumbdbm no longer works and explain to them what to do. Index: storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** storage.py 7 Aug 2003 05:04:09 -0000 1.18 --- storage.py 25 Aug 2003 08:48:56 -0000 1.19 *************** *** 572,575 **** --- 572,621 ---- Trainer.__init__(self, bayes, False, updateprobs) + class NoSuchClassifierError(Exception): + def __init__(self, invalid_name): + self.invalid_name = invalid_name + def __str__(self): + return repr(self.invalid_name) + + _storage_types = {"dbm" : DBDictClassifier, + "pickle" : PickledClassifier, + "pgsql" : PGClassifier, + "mysql" : mySQLClassifier, + } + + def open_storage(data_source_name, useDB=True): + '''Return a storage object appropriate to the given parameters. + + By centralizing this code here, all the applications will behave + the same given the same options. + + If useDB is false, a pickle will be used, otherwise if the data + source name includes "::", whatever is before that determines + the type of database. If the source name doesn't include "::", + then a DBDictClassifier is used.''' + if useDB: + if '::' in data_source_name: + db_type, rest = data_source_name.split('::', 1) + if _storage_types.has_key(db_type.lower()): + klass = _storage_types[db_type.lower()] + data_source_name = rest + else: + raise NoSuchClassifierError(db_type) + else: + klass = DBDictClassifier + else: + klass = PickledClassifier + try: + return klass(data_source_name) + except dbmstorage.error, e: + if str(e) == "No dbm modules available!": + # We expect this to hit a fair few people, so warn them nicely, + # rather than just printing the trackback. + print """You do not have a dbm module available to use. You + need to either use a pickle (see the FAQ), use Python 2.3 (or above), or + install a dbm module such as bsddb (see http://sf.net/projects/pybsddb).""" + import sys + sys.exit() + if __name__ == '__main__': From anadelonbrin at users.sourceforge.net Mon Aug 25 02:55:21 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Aug 25 04:55:25 2003 Subject: [Spambayes-checkins] spambayes README.txt,1.50,1.51 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv2151 Modified Files: README.txt Log Message: Add a note about the difference between TOP and RETR. Index: README.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/README.txt,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** README.txt 25 Aug 2003 01:36:41 -0000 1.50 --- README.txt 25 Aug 2003 08:55:19 -0000 1.51 *************** *** 129,132 **** --- 129,137 ---- header into that folder. + Note that if you set your mail client to delete the mail without + downloading the whole message (like Outlook Express's "delete from server" + rule) that you may not get accurate results - the classification will + be based on the headers only, not the body. This is not recommended. + IMAP Filter From anadelonbrin at users.sourceforge.net Mon Aug 25 03:00:38 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Aug 25 05:00:42 2003 Subject: [Spambayes-checkins] spambayes pop3proxy.py,1.90,1.91 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv2977 Modified Files: pop3proxy.py Log Message: Fix some old option names. Change notate_to and notate_subject options to tuples - if empty, do nothing (like old False), otherwise if classification is in option value, then mutate the header (old True meant only spam messages). Add no_cache_large_messages option. If messages are bigger than this, don't cache them (to avoid caching messages with massive attachments that are already correctly classified). Make pop3proxy and hammie use the storage.open_storage function. Index: pop3proxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** pop3proxy.py 18 Aug 2003 04:52:53 -0000 1.90 --- pop3proxy.py 25 Aug 2003 09:00:33 -0000 1.91 *************** *** 447,453 **** len(args) == 2 and args[1] == '99999999')): cls = msg.GetClassification() ! if cls == options["Hammie", "header_ham_string"]: state.numHams += 1 ! elif cls == options["Hammie", "header_spam_string"]: state.numSpams += 1 else: --- 447,453 ---- len(args) == 2 and args[1] == '99999999')): cls = msg.GetClassification() ! if cls == options["Headers", "header_ham_string"]: state.numHams += 1 ! elif cls == options["Headers", "header_spam_string"]: state.numSpams += 1 else: *************** *** 457,469 **** # "Precedence: list" ham if the options say so. isSuppressedBulkHam = \ ! (cls == options["Hammie", "header_ham_string"] and options["pop3proxy", "no_cache_bulk_ham"] and msg.get('precedence') in ['bulk', 'list']) # Cache the message. Don't pollute the cache with test # messages or suppressed bulk ham. if (not state.isTest and options["pop3proxy", "cache_messages"] and ! not isSuppressedBulkHam): # Write the message into the Unknown cache. message = state.unknownCorpus.makeMessage(msg.getId()) --- 457,475 ---- # "Precedence: list" ham if the options say so. isSuppressedBulkHam = \ ! (cls == options["Headers", "header_ham_string"] and options["pop3proxy", "no_cache_bulk_ham"] and msg.get('precedence') in ['bulk', 'list']) + # Suppress large messages if the options say so. + size_limit = options["pop3proxy", + "no_cache_large_messages"] + isTooBig = size_limit > 0 and \ + len(messageText) > size_limit + # Cache the message. Don't pollute the cache with test # messages or suppressed bulk ham. if (not state.isTest and options["pop3proxy", "cache_messages"] and ! not isSuppressedBulkHam and not isTooBig): # Write the message into the Unknown cache. message = state.unknownCorpus.makeMessage(msg.getId()) *************** *** 610,629 **** filename = options["Storage", "persistent_storage_file"] filename = os.path.expanduser(filename) ! if self.useDB: ! if '::' in filename: ! sql_types = {"pgsql" : storage.PGClassifier, ! "mysql" : storage.mySQLClassifier, ! } ! sql_type, rest = filename.split('::', 1) ! if sql_types.has_key(sql_type.lower()): ! self.bayes = sql_types[sql_type.lower()](filename) ! else: ! # yikes! raise some sort of NoSuchClassifierError ! pass ! else: ! self.bayes = storage.DBDictClassifier(filename) ! else: ! self.bayes = storage.PickledClassifier(filename) ! print "Done." # Don't set up the caches and training objects when running the self-test, --- 616,620 ---- filename = options["Storage", "persistent_storage_file"] filename = os.path.expanduser(filename) ! self.bayes = storage.open_storage(filename, self.useDB) # Don't set up the caches and training objects when running the self-test, *************** *** 759,763 **** def stop(state): state.bayes.store() ! # should we be calling socket.shutdown(2) and close() for each # BayesProxy object? --- 750,754 ---- def stop(state): state.bayes.store() ! # should we be calling socket.shutdown(2) and close_when_done() for each # BayesProxy object? From anadelonbrin at users.sourceforge.net Mon Aug 25 03:00:40 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Aug 25 05:00:50 2003 Subject: [Spambayes-checkins] spambayes/spambayes Options.py, 1.63, 1.64 OptionsClass.py, 1.10, 1.11 hammie.py, 1.5, 1.6 message.py, 1.31, 1.32 storage.py, 1.19, 1.20 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv2977/spambayes Modified Files: Options.py OptionsClass.py hammie.py message.py storage.py Log Message: Fix some old option names. Change notate_to and notate_subject options to tuples - if empty, do nothing (like old False), otherwise if classification is in option value, then mutate the header (old True meant only spam messages). Add no_cache_large_messages option. If messages are bigger than this, don't cache them (to avoid caching messages with massive attachments that are already correctly classified). Make pop3proxy and hammie use the storage.open_storage function. Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Options.py 25 Aug 2003 00:40:44 -0000 1.63 --- Options.py 25 Aug 2003 09:00:36 -0000 1.64 *************** *** 19,22 **** --- 19,23 ---- modules are changed over. """ + import os *************** *** 552,561 **** # The three disposition names are added to the header as the following ! # Three words: ("header_spam_string", "Spam disposition name", "spam", """The header that Spambayes inserts into each email has a name, ! (Header Name, above), and a value. If the classifier determines ! that this email is probably spam, it places a header named as ! above with a value as specified by this string. The default value should work just fine, but you may change it to anything that you wish.""", --- 553,562 ---- # The three disposition names are added to the header as the following ! # three words: ("header_spam_string", "Spam disposition name", "spam", """The header that Spambayes inserts into each email has a name, ! (Classification eader name, above), and a value. If the classifier ! determines that this email is probably spam, it places a header named ! as above with a value as specified by this string. The default value should work just fine, but you may change it to anything that you wish.""", *************** *** 563,568 **** ("header_ham_string", "Ham disposition name", "ham", ! """As for Spam Designation, but for emails classified as ! Ham.""", HEADER_VALUE, RESTORE), --- 564,568 ---- ("header_ham_string", "Ham disposition name", "ham", ! """As for Spam Designation, but for emails classified as Ham.""", HEADER_VALUE, RESTORE), *************** *** 575,579 **** ("header_score_digits", "Accuracy of reported score", 2, ! """Accuracy of the score in the header in decimal digits""", INTEGER, RESTORE), --- 575,579 ---- ("header_score_digits", "Accuracy of reported score", 2, ! """Accuracy of the score in the header in decimal digits.""", INTEGER, RESTORE), *************** *** 588,592 **** probability into each mail. If you can view headers with your mailer, then you can see this information, which can be interesting ! and even instructive if you're a serious Spambayes junkie.""", BOOLEAN, RESTORE), --- 588,592 ---- probability into each mail. If you can view headers with your mailer, then you can see this information, which can be interesting ! and even instructive if you're a serious SpamBayes junkie.""", BOOLEAN, RESTORE), *************** *** 636,644 **** showclue to a lower value, such as 0.1""", REAL, RESTORE), ), ! # pop3proxy settings - pop3proxy also respects the options in the Hammie ! # section, with the exception of the extra header details at the moment. ! # The only mandatory option is pop3proxy_servers, eg. # "pop3.my-isp.com:110", or a comma-separated list of those. The ":110" # is optional. If you specify more than one server in pop3proxy_servers, --- 636,649 ---- showclue to a lower value, such as 0.1""", REAL, RESTORE), + + ("add_unique_id", "Add unique spambayes id", True, + """If you wish to be able to find a specific message (via the 'find' + box on the home page), or use the SMTP proxy to train using cached + messages, you will need to know the unique id of each message. This + option adds this information to a header added to each message.""", + BOOLEAN, RESTORE), ), ! # pop3proxy settings: The only mandatory option is pop3proxy_servers, eg. # "pop3.my-isp.com:110", or a comma-separated list of those. The ":110" # is optional. If you specify more than one server in pop3proxy_servers, *************** *** 646,650 **** "pop3proxy" : ( ("remote_servers", "Remote Servers", (), ! """The Spambayes POP3 proxy intercepts incoming email and classifies it before sending it on to your email client. You need to specify which POP3 server(s) you wish it to intercept - a POP3 server --- 651,655 ---- "pop3proxy" : ( ("remote_servers", "Remote Servers", (), ! """The SpamBayes POP3 proxy intercepts incoming email and classifies it before sending it on to your email client. You need to specify which POP3 server(s) you wish it to intercept - a POP3 server *************** *** 653,665 **** these server names from your existing email configuration, or from your ISP or system administrator. If you are using Web-based email, ! you can't use the Spambayes POP3 proxy (sorry!). In your email client's configuration, where you would normally put your POP3 server address, you should now put the address of the machine running ! Spambayes.""", SERVER, DO_NOT_RESTORE), ("listen_ports", "SpamBayes Ports", (), """Each POP3 server that is being monitored must be assigned to a ! 'port' in the Spambayes POP3 proxy. This port must be different for each monitored server, and there must be a port for each monitored server. Again, you need to configure your email --- 658,670 ---- these server names from your existing email configuration, or from your ISP or system administrator. If you are using Web-based email, ! you can't use the SpamBayes POP3 proxy (sorry!). In your email client's configuration, where you would normally put your POP3 server address, you should now put the address of the machine running ! SpamBayes.""", SERVER, DO_NOT_RESTORE), ("listen_ports", "SpamBayes Ports", (), """Each POP3 server that is being monitored must be assigned to a ! 'port' in the SpamBayes POP3 proxy. This port must be different for each monitored server, and there must be a port for each monitored server. Again, you need to configure your email *************** *** 688,709 **** PATH, DO_NOT_RESTORE), ! ("notate_to", "Notate to", False, ! """Some email clients (Outlook Express, for example) can only ! set up filtering rules on a limited set of headers. These ! clients cannot test for the existence/value of an arbitrary ! header and filter mail based on that information. To ! accomodate these kind of mail clients, the Notate To: can be ! checked, which will add "spam", "ham", or "unsure" to the ! recipient list. A filter rule can then use this to see if ! one of these words (followed by a comma) is in the recipient ! list, and route the mail to an appropriate folder, or take ! whatever other action is supported and appropriate for the ! mail classification.""", ! BOOLEAN, RESTORE), ! ("notate_subject", "Classify in subject: header", False, """This option will add the same information as 'Notate To', but to the start of the mail subject line.""", ! BOOLEAN, RESTORE), ("cache_messages", "Cache messages", True, --- 693,716 ---- PATH, DO_NOT_RESTORE), ! ("notate_to", "Notate to", (), ! """Some email clients (Outlook Express, for example) can only set up ! filtering rules on a limited set of headers. These clients cannot ! test for the existence/value of an arbitrary header and filter mail ! based on that information. To accomodate these kind of mail clients, ! you can add "spam", "ham", or "unsure" to the recipient list. A ! filter rule can then use this to see if one of these words (followed ! by a comma) is in the recipient list, and route the mail to an ! appropriate folder, or take whatever other action is supported and ! appropriate for the mail classification. ! As it interferes with replying, you may only wish to do this for ! spam messages; simply tick the boxes of the classifications take ! should be identified in this fashion.""", ! ("ham", "spam", "unsure"), RESTORE), ! ! ("notate_subject", "Classify in subject: header", (), """This option will add the same information as 'Notate To', but to the start of the mail subject line.""", ! ("ham", "spam", "unsure"), RESTORE), ("cache_messages", "Cache messages", True, *************** *** 727,751 **** BOOLEAN, RESTORE), ! ("add_mailid_to", "Add unique spambayes id", (), ! """If you wish to be able to find a specific message (via the 'find' ! box on the home page), or use the SMTP proxy to ! train, you will need to know the unique id of each message. If your ! mailer allows you to view all message headers, and includes all these ! headers in forwarded/bounced mail, then the best place for this id ! is in the headers of incoming mail. Unfortunately, some mail clients ! do not offer these capabilities. For these clients, you will need to ! have the id added to the body of the message. If you are not sure, ! the safest option is to use both.""", ! ("header", "body"), True), ! ! ("strip_incoming_mailids", "Strip incoming spambayes ids", False, ! """If you receive messages from other spambayes users, you might ! find that incoming mail (generally replies) already has an id, ! particularly if they have set the id to appear in the body (see ! above). This might confuse the SMTP proxy when it tries to identify ! the message to train, and make it difficult for you to identify ! the correct id to find a message. This option strips all spambayes ! ids from incoming mail.""", ! BOOLEAN, RESTORE), ), --- 734,744 ---- BOOLEAN, RESTORE), ! ("no_cache_large_messages", "Maximum size of cached messages", 0, ! """Where message caching is enabled, this option suppresses caching ! of messages which are larger than this value. If you receive a lot ! of messages that include large attachments (and are correctly ! classified), you may not wish to cache these. If you set this to ! zero (0), then this option will have no effect.""", ! INTEGER, RESTORE), ), *************** *** 792,795 **** --- 785,802 ---- spam@nowhere.nothing.""", EMAIL_ADDRESS, RESTORE), + + ("use_cached_message", "Lookup message in cache", False, + """If this option is set, then the smtpproxy will attempt to + look up the messages sent to it (for training) in the POP3 proxy cache + or IMAP filter folders, and use that message as the training data. + This avoids any problems where your mail client might change the + message when forwarding, contaminating your training data. If you can + be sure that this won't occur, then the id-lookup can be avoided. + + Note that Outlook Express users cannot use the lookup option (because + of the way messages are forwarded), and so if they wish to use the + SMTP proxy they must enable this option (but as messages are altered, + may not get the best results, and this is not recommended).""", + BOOLEAN, RESTORE), ), *************** *** 975,978 **** if not optionsPathname: optionsPathname = os.path.abspath('bayescustomize.ini') - # Set verbosity of this options instance to an option value! - options.verbose = options["globals", "verbose"] --- 982,983 ---- Index: OptionsClass.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/OptionsClass.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** OptionsClass.py 21 Aug 2003 13:06:59 -0000 1.10 --- OptionsClass.py 25 Aug 2003 09:00:36 -0000 1.11 *************** *** 587,590 **** --- 587,591 ---- sect, opt = self.conversion_table[sect, opt] return self._options[sect, opt] + def get(self, sect, opt): '''Get an option value.''' *************** *** 695,699 **** FILE = r"[\S]+" FILE_WITH_PATH = PATH ! IP_LIST = r"\*|localhost|((\*|[01]?\d\d?|2[04]\d|25[0-5])\.(\*|[01]?\d\d?|2[04]\d|25[0-5])\.(\*|[01]?\d\d?|2[04]\d|25[0-5])\.(\*|[01]?\d\d?|2[04]\d|25[0-5]),?)+" # IMAP seems to allow any character at all in a folder name, # but we want to use the comma as a delimiter for lists, so --- 696,702 ---- FILE = r"[\S]+" FILE_WITH_PATH = PATH ! IP_LIST = r"\*|localhost|((\*|[01]?\d\d?|2[04]\d|25[0-5])\.(\*|[01]?\d" \ ! r"\d?|2[04]\d|25[0-5])\.(\*|[01]?\d\d?|2[04]\d|25[0-5])\.(\*" \ ! r"|[01]?\d\d?|2[04]\d|25[0-5]),?)+" # IMAP seems to allow any character at all in a folder name, # but we want to use the comma as a delimiter for lists, so Index: hammie.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/hammie.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hammie.py 29 Jan 2003 03:23:34 -0000 1.5 --- hammie.py 25 Aug 2003 09:00:36 -0000 1.6 *************** *** 247,251 **** ! def open(filename, usedb=True, mode='r'): """Open a file, returning a Hammie instance. --- 247,251 ---- ! def open(filename, useDB=True, mode='r'): """Open a file, returning a Hammie instance. *************** *** 254,265 **** used as the flag to open DBDict objects. 'c' for read-write (create if needed), 'r' for read-only, 'w' for read-write. - """ ! ! if usedb: ! b = storage.DBDictClassifier(filename, mode) ! else: ! b = storage.PickledClassifier(filename) ! return Hammie(b) --- 254,259 ---- used as the flag to open DBDict objects. 'c' for read-write (create if needed), 'r' for read-only, 'w' for read-write. """ ! return Hammie(storage.open_storage((filename, mode), useDB) Index: message.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** message.py 18 Jul 2003 21:19:58 -0000 1.31 --- message.py 25 Aug 2003 09:00:37 -0000 1.32 *************** *** 71,75 **** """ ! # This module is part of the spambayes project, which is Copyright 2002 # The Python Software Foundation and is covered by the Python Software # Foundation license. --- 71,75 ---- """ ! # This module is part of the spambayes project, which is Copyright 2002-3 # The Python Software Foundation and is covered by the Python Software # Foundation license. *************** *** 111,131 **** self.mode = mode self.db_name = db_name ! self.dbm = dbmstorage.open(self.db_name, self.mode) ! self.db = shelve.Shelf(self.dbm) def store(self): ! self.db.sync() def _getState(self, msg): ! try: ! (msg.c, msg.t) = self.db[msg.getId()] ! except KeyError: ! pass def _setState(self, msg): ! self.db[msg.getId()] = (msg.c, msg.t) def _delState(self, msg): ! del self.db[msg.getId()] # This should come from a Mark Hammond idea of a master db --- 111,144 ---- self.mode = mode self.db_name = db_name ! try: ! self.dbm = dbmstorage.open(self.db_name, self.mode) ! except dbmstorage.error: ! # This probably means that we don't have a dbm module ! # available. Print out a warning, and continue on ! # (not persisting any of this data). ! if options["globals", "verbose"]: ! print "Warning: no dbm modules available for MessageInfoDB" ! self.dbm = self.db = None ! if self.dbm: ! self.db = shelve.Shelf(self.dbm) def store(self): ! if self.db: ! self.db.sync() def _getState(self, msg): ! if self.db: ! try: ! (msg.c, msg.t) = self.db[msg.getId()] ! except KeyError: ! pass def _setState(self, msg): ! if self.db: ! self.db[msg.getId()] = (msg.c, msg.t) def _delState(self, msg): ! if self.db: ! del self.db[msg.getId()] # This should come from a Mark Hammond idea of a master db *************** *** 205,214 **** def GetClassification(self): if self.c == 's': ! return options['Hammie','header_spam_string'] ! if self.c == 'h': ! return options['Hammie','header_ham_string'] ! if self.c == 'u': ! return options['Hammie','header_unsure_string'] ! return None --- 218,226 ---- def GetClassification(self): if self.c == 's': ! return options['Headers','header_spam_string'] ! elif self.c == 'h': ! return options['Headers','header_ham_string'] ! elif self.c == 'u': ! return options['Headers','header_unsure_string'] return None *************** *** 217,230 **** # may change, which would really screw this database up ! if cls == options['Hammie','header_spam_string']: self.c = 's' ! elif cls == options['Hammie','header_ham_string']: self.c = 'h' ! elif cls == options['Hammie','header_unsure_string']: self.c = 'u' else: raise ValueError, \ "Classification must match header strings in options" - self.modified() --- 229,241 ---- # may change, which would really screw this database up ! if cls == options['Headers','header_spam_string']: self.c = 's' ! elif cls == options['Headers','header_ham_string']: self.c = 'h' ! elif cls == options['Headers','header_unsure_string']: self.c = 'u' else: raise ValueError, \ "Classification must match header strings in options" self.modified() *************** *** 311,317 **** # allow filtering in 'stripped down' mailers like Outlook Express, # so for the moment, they stay in. ! if options["pop3proxy", "notate_to"] \ ! and disposition == options["Headers", "header_spam_string"]: ! # add 'spam' as recip only if spam try: self.replace_header("To", "%s,%s" % (disposition, --- 322,326 ---- # allow filtering in 'stripped down' mailers like Outlook Express, # so for the moment, they stay in. ! if disposition in options["pop3proxy", "notate_to"]: try: self.replace_header("To", "%s,%s" % (disposition, *************** *** 320,326 **** self["To"] = disposition ! if options["pop3proxy", "notate_subject"] \ ! and disposition == options["Hammie", "header_spam_string"]: ! # add 'spam' to subject if spam try: self.replace_header("Subject", "%s,%s" % (disposition, --- 329,333 ---- self["To"] = disposition ! if disposition in options["pop3proxy", "notate_subject"]: try: self.replace_header("Subject", "%s,%s" % (disposition, *************** *** 329,349 **** self["Subject"] = disposition ! if "header" in options['pop3proxy','add_mailid_to']: self[options['pop3proxy','mailid_header_name']] = self.id - # This won't work for now, because email.Message does not isolate message body - # This is also not consistent with the function of this method... - # if options.pop3proxy_add_mailid_to.find("body") != -1: - # body = body[:len(body)-3] + \ - # options.pop3proxy_mailid_header_name + ": " \ - # + messageName + "\r\n.\r\n" - def delSBHeaders(self): ! del self[options['Hammie','header_name']] ! del self[options['pop3proxy','mailid_header_name']] ! del self[options['Hammie','header_name'] + "-ID"] # test mode header ! del self[options['pop3proxy','prob_header_name']] ! del self[options['pop3proxy','thermostat_header_name']] ! del self[options['pop3proxy','evidence_header_name']] # These perform similar functions to email.message_from_string() --- 336,351 ---- self["Subject"] = disposition ! if options['Headers','add_unique_id']: self[options['pop3proxy','mailid_header_name']] = self.id def delSBHeaders(self): ! del self[options['Headers','classification_header_name']] ! del self[options['Headers','mailid_header_name']] ! del self[options['Headers','classification_header_name'] + "-ID"] # test mode header ! del self[options['Headers','prob_header_name']] ! del self[options['Headers','thermostat_header_name']] ! del self[options['Headers','evidence_header_name']] ! del self[options['Headers','score_header_name']] ! del self[options['Headers','trained_header_name']] # These perform similar functions to email.message_from_string() Index: storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** storage.py 25 Aug 2003 08:48:56 -0000 1.19 --- storage.py 25 Aug 2003 09:00:37 -0000 1.20 *************** *** 607,610 **** --- 607,612 ---- klass = PickledClassifier try: + if isinstance(data_source_name), type(())): + return klass(*data_source_name) return klass(data_source_name) except dbmstorage.error, e: From anadelonbrin at users.sourceforge.net Mon Aug 25 03:10:02 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Aug 25 05:10:24 2003 Subject: [Spambayes-checkins] spambayes/spambayes storage.py,1.20,1.21 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv4323/spambayes Modified Files: storage.py Log Message: Rouge comma. Index: storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** storage.py 25 Aug 2003 09:00:37 -0000 1.20 --- storage.py 25 Aug 2003 09:10:00 -0000 1.21 *************** *** 607,611 **** klass = PickledClassifier try: ! if isinstance(data_source_name), type(())): return klass(*data_source_name) return klass(data_source_name) --- 607,611 ---- klass = PickledClassifier try: ! if isinstance(data_source_name, type(())): return klass(*data_source_name) return klass(data_source_name) From ta-meyer at ihug.co.nz Mon Aug 25 22:18:25 2003 From: ta-meyer at ihug.co.nz (Tony Meyer) Date: Mon Aug 25 05:19:24 2003 Subject: [Spambayes-checkins] spambayes/spambayes storage.py,1.20,1.21 Message-ID: <1ED4ECF91CDED24C8D012BCF2B034F130212AD39@its-xchg4.massey.ac.nz> > Modified Files: > storage.py > Log Message: > Rouge comma. I meant rogue of course, unless the source code has gotten into the makeup... =Tony Meyer From xenogeist at users.sourceforge.net Mon Aug 25 07:35:03 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 09:35:08 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources sblogo.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv17218/Outlook2000/dialogs/resources Modified Files: sblogo.bmp Log Message: resized logo. why does msvs display units no one uses . Index: sblogo.bmp =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/sblogo.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsUoPi1Z and /tmp/cvsg3DWAR differ From xenogeist at users.sourceforge.net Mon Aug 25 07:44:08 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 09:49:14 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.19, 1.20 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv18428/Outlook2000/dialogs/resources Modified Files: dialogs.rc Log Message: more spellchecking. Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** dialogs.rc 24 Aug 2003 14:08:03 -0000 1.19 --- dialogs.rc 25 Aug 2003 13:44:06 -0000 1.20 *************** *** 295,299 **** IDC_STATIC,11,8,191,14 PUSHBUTTON "About...",IDC_BUT_ABOUT,214,140,60,15 ! LTEXT "SpamBayes is a system that learns about good and bad mail based on examples you provide. It comes with no builtin rules, so must have some training information before it will be effective", IDC_STATIC,11,21,263,30 LTEXT "In this case, SpamBayes will begin by filtering all mail to an 'Unsure' folder. You can then use the 'Delete as Spam' and 'Recover from Spam' buttons to train each message as it arrives. Slowly SpamBayes will learn about your mail.", --- 295,299 ---- IDC_STATIC,11,8,191,14 PUSHBUTTON "About...",IDC_BUT_ABOUT,214,140,60,15 ! LTEXT "SpamBayes is a system that learns about good and bad mail based on examples you provide. It comes with no built-in rules, so must have some training information before it will be effective", IDC_STATIC,11,21,263,30 LTEXT "In this case, SpamBayes will begin by filtering all mail to an 'Unsure' folder. You can then use the 'Delete as Spam' and 'Recover from Spam' buttons to train each message as it arrives. Slowly SpamBayes will learn about your mail.", *************** *** 324,328 **** LTEXT "For examples of spam messages, you may like to look through your Deleted Items folder, and your Inbox. However, you will not be able to specify the Deleted Items folder as examples of spam, so you will need to move them to a folder you create.", IDC_STATIC,20,82,247,35 ! LTEXT "When you are finished, open the SpamBayes Manager via the SpamBayes toobar, and re-start the Configuration Wizard.", IDC_STATIC,20,121,245,17 END --- 324,328 ---- LTEXT "For examples of spam messages, you may like to look through your Deleted Items folder, and your Inbox. However, you will not be able to specify the Deleted Items folder as examples of spam, so you will need to move them to a folder you create.", IDC_STATIC,20,82,247,35 ! LTEXT "When you are finished, open the SpamBayes Manager via the SpamBayes toolbar, and re-start the Configuration Wizard.", IDC_STATIC,20,121,245,17 END From xenogeist at users.sourceforge.net Mon Aug 25 08:29:35 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 10:30:14 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.22, 1.23 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv26373/Outlook2000/dialogs Modified Files: dialog_map.py Log Message: Move Filter Now to a seperate dialog invoked by the drop down menu on the toolbar. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** dialog_map.py 25 Aug 2003 04:23:16 -0000 1.22 --- dialog_map.py 25 Aug 2003 14:29:33 -0000 1.23 *************** *** 382,386 **** (TabProcessor, "IDC_TAB", """IDD_GENERAL IDD_FILTER IDD_TRAINING - IDD_FILTER_NOW IDD_ADVANCED"""), (CommandButtonProcessor, "IDC_ABOUT_BTN", ShowAbout, ()), --- 382,385 ---- *************** *** 396,399 **** --- 395,399 ---- ), "IDD_FILTER_NOW" : ( + (CloseButtonProcessor, "IDOK"), (BoolButtonProcessor, "IDC_BUT_UNREAD", "Filter_Now.only_unread"), (BoolButtonProcessor, "IDC_BUT_UNSEEN", "Filter_Now.only_unseen"), *************** *** 406,410 **** filter.filterer, "Start Filtering", "Stop Filtering", ! """IDOK IDCANCEL IDC_TAB IDC_BUT_UNSEEN IDC_BUT_UNREAD IDC_BROWSE IDC_BUT_ACT_SCORE IDC_BUT_ACT_ALL"""), --- 406,410 ---- filter.filterer, "Start Filtering", "Stop Filtering", ! """IDOK IDC_BUT_UNSEEN IDC_BUT_UNREAD IDC_BROWSE IDC_BUT_ACT_SCORE IDC_BUT_ACT_ALL"""), From xenogeist at users.sourceforge.net Mon Aug 25 08:29:35 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 10:30:32 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.97, 1.98 manager.py, 1.79, 1.80 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv26373/Outlook2000 Modified Files: addin.py manager.py Log Message: Move Filter Now to a seperate dialog invoked by the drop down menu on the toolbar. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** addin.py 25 Aug 2003 01:33:11 -0000 1.97 --- addin.py 25 Aug 2003 14:29:33 -0000 1.98 *************** *** 796,799 **** --- 796,806 ---- self._AddControl(popup, constants.msoControlButton, + ButtonEvent, (manager.ShowFilterNow,), + Caption="Filter messages...", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.FilterNow") + self._AddControl(popup, + constants.msoControlButton, ButtonEvent, (CheckLatestVersion, self.manager,), Caption="Check for new version", Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** manager.py 25 Aug 2003 05:33:23 -0000 1.79 --- manager.py 25 Aug 2003 14:29:33 -0000 1.80 *************** *** 782,785 **** --- 782,790 ---- # And re-save now, just incase Outlook dies on the way down. self.SaveConfig() + def ShowFilterNow(self): + import dialogs + dialogs.ShowDialog(0, self, self.config, "IDD_FILTER_NOW") + # And re-save now, just incase Outlook dies on the way down. + self.SaveConfig() def ShowHtml(self,url): From xenogeist at users.sourceforge.net Mon Aug 25 08:29:35 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 10:30:42 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.20, 1.21 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv26373/Outlook2000/dialogs/resources Modified Files: dialogs.rc Log Message: Move Filter Now to a seperate dialog invoked by the drop down menu on the toolbar. Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** dialogs.rc 25 Aug 2003 13:44:06 -0000 1.20 --- dialogs.rc 25 Aug 2003 14:29:33 -0000 1.21 *************** *** 535,540 **** END ! IDD_FILTER_NOW DIALOGEX 0, 0, 244, 178 ! STYLE DS_SETFONT | DS_MODALFRAME | WS_CHILD | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Now" --- 535,540 ---- END ! IDD_FILTER_NOW DIALOGEX 0, 0, 244, 185 ! STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "Filter Now" *************** *** 561,564 **** --- 561,565 ---- LTEXT "Static",IDC_PROGRESS_TEXT,7,144,227,10 PUSHBUTTON "Start Filtering",IDC_START,7,161,52,14 + DEFPUSHBUTTON "Close",IDOK,187,162,50,14 END *************** *** 651,654 **** --- 652,663 ---- VERTGUIDE, 242 BOTTOMMARGIN, 207 + END + + IDD_FILTER_NOW, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 237 + TOPMARGIN, 9 + BOTTOMMARGIN, 176 END From xenogeist at users.sourceforge.net Mon Aug 25 08:48:44 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 10:48:49 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.21, 1.22 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv29489/Outlook2000/dialogs/resources Modified Files: dialogs.rc Log Message: Split a line that msvs complains about being too long into two static controls. Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** dialogs.rc 25 Aug 2003 14:29:33 -0000 1.21 --- dialogs.rc 25 Aug 2003 14:48:42 -0000 1.22 *************** *** 320,327 **** LTEXT "Click Finish to close the wizard.",IDC_STATIC,20,145, 148,9 ! LTEXT "For examples of good messages, you may like to use your Inbox - however, it is important you remove all spam from this folder before you commence training. If you have too much spam in your Inbox, you may like to create a temporary folder and copy some examples to it.", ! IDC_STATIC,20,46,247,35 LTEXT "For examples of spam messages, you may like to look through your Deleted Items folder, and your Inbox. However, you will not be able to specify the Deleted Items folder as examples of spam, so you will need to move them to a folder you create.", ! IDC_STATIC,20,82,247,35 LTEXT "When you are finished, open the SpamBayes Manager via the SpamBayes toolbar, and re-start the Configuration Wizard.", IDC_STATIC,20,121,245,17 --- 320,329 ---- LTEXT "Click Finish to close the wizard.",IDC_STATIC,20,145, 148,9 ! LTEXT "For examples of good messages, you may like to use your Inbox - however, it is important you remove all spam from this folder before you commence", ! IDC_STATIC,20,42,247,26 ! LTEXT "training. If you have too much spam in your Inbox, you may like to create a temporary folder and copy some examples to it.", ! IDC_STATIC,20,58,247,17 LTEXT "For examples of spam messages, you may like to look through your Deleted Items folder, and your Inbox. However, you will not be able to specify the Deleted Items folder as examples of spam, so you will need to move them to a folder you create.", ! IDC_STATIC,20,80,247,35 LTEXT "When you are finished, open the SpamBayes Manager via the SpamBayes toolbar, and re-start the Configuration Wizard.", IDC_STATIC,20,121,245,17 From xenogeist at users.sourceforge.net Mon Aug 25 08:56:34 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 10:56:45 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.22, 1.23 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv30755/Outlook2000/dialogs/resources Modified Files: dialogs.rc Log Message: Added full-stops to the wizard info. Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** dialogs.rc 25 Aug 2003 14:48:42 -0000 1.22 --- dialogs.rc 25 Aug 2003 14:56:32 -0000 1.23 *************** *** 151,168 **** IDC_STATIC,20,4,191,14 PUSHBUTTON "About...",IDC_BUT_ABOUT,215,104,60,15 ! LTEXT "This wizard will help you configure the SpamBayes Outlook addin. Please indicate how you have prepared for this application", IDC_STATIC,20,20,255,18 ! CONTROL "I haven't prepared for SpamBayes at all", IDC_BUT_PREPARATION,"Button",BS_AUTORADIOBUTTON | BS_TOP | WS_GROUP,20,42,190,11 ! CONTROL "I have already sorted good messages (ham) and spam messages into folders that are suitable for training purposes", IDC_STATIC,"Button",BS_AUTORADIOBUTTON | BS_TOP | BS_MULTILINE,20,59,255,25 ! CONTROL "I would prefer to configure SpamBayes manually", IDC_STATIC,"Button",BS_AUTORADIOBUTTON | BS_TOP,20,82, 187,14 ! LTEXT "If you would like more information about training and configuring SpamBayes, click the About button", IDC_STATIC,20,103,185,20 ! LTEXT "If you cancel the wizard, you can access it again via the SpamBayes Manager, available from the SpamBayes toolbar", IDC_STATIC,20,137,232,17 END --- 151,168 ---- IDC_STATIC,20,4,191,14 PUSHBUTTON "About...",IDC_BUT_ABOUT,215,104,60,15 ! LTEXT "This wizard will help you configure the SpamBayes Outlook addin. Please indicate how you have prepared for this application.", IDC_STATIC,20,20,255,18 ! CONTROL "I haven't prepared for SpamBayes at all.", IDC_BUT_PREPARATION,"Button",BS_AUTORADIOBUTTON | BS_TOP | WS_GROUP,20,42,190,11 ! CONTROL "I have already sorted good messages (ham) and spam messages into folders that are suitable for training purposes.", IDC_STATIC,"Button",BS_AUTORADIOBUTTON | BS_TOP | BS_MULTILINE,20,59,255,25 ! CONTROL "I would prefer to configure SpamBayes manually.", IDC_STATIC,"Button",BS_AUTORADIOBUTTON | BS_TOP,20,82, 187,14 ! LTEXT "If you would like more information about training and configuring SpamBayes, click the About button.", IDC_STATIC,20,103,185,20 ! LTEXT "If you cancel the wizard, you can access it again via the SpamBayes Manager, available from the SpamBayes toolbar.", IDC_STATIC,20,137,232,17 END *************** *** 180,184 **** LTEXT "If you wish to speed up the training process, you can move all the existing Spam from your Inbox to the new Spam folder, then select 'Training' from the SpamBayes manager.", IDC_STATIC,20,83,247,31 ! LTEXT "As you train, you will find the accuracy of SpamBayes increases", IDC_STATIC,20,69,247,15 LTEXT "Click Finish to close the wizard.",IDC_STATIC,20,121, --- 180,184 ---- LTEXT "If you wish to speed up the training process, you can move all the existing Spam from your Inbox to the new Spam folder, then select 'Training' from the SpamBayes manager.", IDC_STATIC,20,83,247,31 ! LTEXT "As you train, you will find the accuracy of SpamBayes increases.", IDC_STATIC,20,69,247,15 LTEXT "Click Finish to close the wizard.",IDC_STATIC,20,121, *************** *** 195,199 **** LTEXT "SpamBayes uses two folders to manage your Spam - a folder where 'certain' spam is stored, and another for unsure messages.", IDC_STATIC,20,20,247,22 ! LTEXT "If you enter a folder name and it does not exist, it will be automatically created. If you would prefer to select an existing folder, click the Browse button", IDC_STATIC,20,44,243,24 EDITTEXT IDC_FOLDER_CERTAIN,20,85,179,14,ES_AUTOHSCROLL --- 195,199 ---- LTEXT "SpamBayes uses two folders to manage your Spam - a folder where 'certain' spam is stored, and another for unsure messages.", IDC_STATIC,20,20,247,22 ! LTEXT "If you enter a folder name and it does not exist, it will be automatically created. If you would prefer to select an existing folder, click the Browse button.", IDC_STATIC,20,44,243,24 EDITTEXT IDC_FOLDER_CERTAIN,20,85,179,14,ES_AUTOHSCROLL *************** *** 214,222 **** LTEXT "Folders that receive new messages",IDC_STATIC,20,4,247, 14 ! LTEXT "SpamBayes needs to know what folders are used to receive new messages. In most cases, this will be your Inbox, but you may also specify additional folders to be watched for spam", IDC_STATIC,20,21,247,25 LTEXT "The following folders will be watched for new messages", IDC_STATIC,20,90,247,13 ! LTEXT "If you use the Outlook rule wizard to move messages into folders, you may like to select these folders in addition to your inbox", IDC_STATIC,20,51,241,20 EDITTEXT IDC_FOLDER_WATCH,20,100,195,48,ES_MULTILINE | --- 214,222 ---- LTEXT "Folders that receive new messages",IDC_STATIC,20,4,247, 14 ! LTEXT "SpamBayes needs to know what folders are used to receive new messages. In most cases, this will be your Inbox, but you may also specify additional folders to be watched for spam.", IDC_STATIC,20,21,247,25 LTEXT "The following folders will be watched for new messages", IDC_STATIC,20,90,247,13 ! LTEXT "If you use the Outlook rule wizard to move messages into folders, you may like to select these folders in addition to your inbox.", IDC_STATIC,20,51,241,20 EDITTEXT IDC_FOLDER_WATCH,20,100,195,48,ES_MULTILINE | *************** *** 253,257 **** 20,38,153,8 PUSHBUTTON "Browse...",IDC_BROWSE_SPAM,208,81,60,15 ! LTEXT "If you have not pre-sorted your messages, or already have training information you wish to keep, please select the Back button and indicate you have not prepared for SpamBayes", IDC_STATIC,20,128,243,26 CONTROL "Score messages when training is complete", --- 253,257 ---- 20,38,153,8 PUSHBUTTON "Browse...",IDC_BROWSE_SPAM,208,81,60,15 ! LTEXT "If you have not pre-sorted your messages, or already have training information you wish to keep, please select the Back button and indicate you have not prepared for SpamBayes.", IDC_STATIC,20,128,243,26 CONTROL "Score messages when training is complete", *************** *** 266,270 **** BEGIN LTEXT "Training",-1,20,4,247,14 ! LTEXT "SpamBayes is training on your good and spam messages", -1,20,22,247,16 CONTROL "",IDC_PROGRESS,"msctls_progress32",WS_BORDER,20,45,255, --- 266,270 ---- BEGIN LTEXT "Training",-1,20,4,247,14 ! LTEXT "SpamBayes is training on your good and spam messages.", -1,20,22,247,16 CONTROL "",IDC_PROGRESS,"msctls_progress32",WS_BORDER,20,45,255, *************** *** 292,299 **** FONT 8, "Tahoma", 0, 0, 0x0 BEGIN ! LTEXT "SpamBayes will not be effective until it is trained", IDC_STATIC,11,8,191,14 PUSHBUTTON "About...",IDC_BUT_ABOUT,214,140,60,15 ! LTEXT "SpamBayes is a system that learns about good and bad mail based on examples you provide. It comes with no built-in rules, so must have some training information before it will be effective", IDC_STATIC,11,21,263,30 LTEXT "In this case, SpamBayes will begin by filtering all mail to an 'Unsure' folder. You can then use the 'Delete as Spam' and 'Recover from Spam' buttons to train each message as it arrives. Slowly SpamBayes will learn about your mail.", --- 292,299 ---- FONT 8, "Tahoma", 0, 0, 0x0 BEGIN ! LTEXT "SpamBayes will not be effective until it is trained.", IDC_STATIC,11,8,191,14 PUSHBUTTON "About...",IDC_BUT_ABOUT,214,140,60,15 ! LTEXT "SpamBayes is a system that learns about good and bad mail based on examples you provide. It comes with no built-in rules, so must have some training information before it will be effective.", IDC_STATIC,11,21,263,30 LTEXT "In this case, SpamBayes will begin by filtering all mail to an 'Unsure' folder. You can then use the 'Delete as Spam' and 'Recover from Spam' buttons to train each message as it arrives. Slowly SpamBayes will learn about your mail.", From montanaro at users.sourceforge.net Mon Aug 25 09:31:41 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Mon Aug 25 11:31:46 2003 Subject: [Spambayes-checkins] spambayes/spambayes storage.py,1.21,1.22 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv5973 Modified Files: storage.py Log Message: use """ for doc string to make emacs happier locate the "::" using find() for 2.2 compatibility Index: storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** storage.py 25 Aug 2003 09:10:00 -0000 1.21 --- storage.py 25 Aug 2003 15:31:39 -0000 1.22 *************** *** 585,589 **** def open_storage(data_source_name, useDB=True): ! '''Return a storage object appropriate to the given parameters. By centralizing this code here, all the applications will behave --- 585,589 ---- def open_storage(data_source_name, useDB=True): ! """Return a storage object appropriate to the given parameters. By centralizing this code here, all the applications will behave *************** *** 593,599 **** source name includes "::", whatever is before that determines the type of database. If the source name doesn't include "::", ! then a DBDictClassifier is used.''' if useDB: ! if '::' in data_source_name: db_type, rest = data_source_name.split('::', 1) if _storage_types.has_key(db_type.lower()): --- 593,599 ---- source name includes "::", whatever is before that determines the type of database. If the source name doesn't include "::", ! then a DBDictClassifier is used.""" if useDB: ! if data_source_name.find('::') != -1: db_type, rest = data_source_name.split('::', 1) if _storage_types.has_key(db_type.lower()): From xenogeist at users.sourceforge.net Mon Aug 25 11:05:37 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 13:06:07 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.23, 1.24 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv24316/Outlook2000/dialogs Modified Files: dialog_map.py Log Message: Added button on advanced tab to display the spambayes data folder. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** dialog_map.py 25 Aug 2003 14:29:33 -0000 1.23 --- dialog_map.py 25 Aug 2003 17:05:35 -0000 1.24 *************** *** 242,245 **** --- 242,248 ---- def ShowAbout(window): window.manager.ShowHtml("about.html") + def ShowDataFolder(window): + import os + os.startfile(window.manager.windows_data_directory) def ResetConfig(window): *************** *** 456,459 **** --- 459,463 ---- (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Experimental.timer_only_receive_folders"), (HiddenDialogCommand, "IDC_HIDDEN", "IDD_DIAGNOSTIC"), + (CommandButtonProcessor, "IDC_SHOW_DATA_FOLDER", ShowDataFolder, ()), ), "IDD_DIAGNOSTIC" : ( From xenogeist at users.sourceforge.net Mon Aug 25 11:05:38 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 13:06:15 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.h, 1.13, 1.14 dialogs.rc, 1.23, 1.24 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv24316/Outlook2000/dialogs/resources Modified Files: dialogs.h dialogs.rc Log Message: Added button on advanced tab to display the spambayes data folder. Index: dialogs.h =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dialogs.h 24 Aug 2003 07:56:52 -0000 1.13 --- dialogs.h 25 Aug 2003 17:05:35 -0000 1.14 *************** *** 90,93 **** --- 90,94 ---- #define IDC_BACK_BTN 1069 #define IDC_BUT_WIZARD 1069 + #define IDC_SHOW_DATA_FOLDER 1069 #define IDC_ABOUT_BTN 1070 #define IDC_BUT_RESET 1070 Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** dialogs.rc 25 Aug 2003 14:56:32 -0000 1.23 --- dialogs.rc 25 Aug 2003 17:05:35 -0000 1.24 *************** *** 49,52 **** --- 49,53 ---- LTEXT "I'm not here. Don't Right Click me.",IDC_HIDDEN,165,118, 69,46 + PUSHBUTTON "Show Data Folder",IDC_SHOW_DATA_FOLDER,7,108,60,14 END From xenogeist at users.sourceforge.net Mon Aug 25 11:28:11 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 25 13:29:14 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.h, 1.14, 1.15 rcparser.py, 1.8, 1.9 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv28064/Outlook2000/dialogs/resources Modified Files: dialogs.h rcparser.py Log Message: Fix duped ids. Index: dialogs.h =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dialogs.h 25 Aug 2003 17:05:35 -0000 1.14 --- dialogs.h 25 Aug 2003 17:28:09 -0000 1.15 *************** *** 87,103 **** #define IDC_USE_DELAY2 1065 #define IDC_TAB 1068 - #define IDC_BUTTON1 1069 #define IDC_BACK_BTN 1069 ! #define IDC_BUT_WIZARD 1069 ! #define IDC_SHOW_DATA_FOLDER 1069 ! #define IDC_ABOUT_BTN 1070 ! #define IDC_BUT_RESET 1070 ! #define IDC_DEL_SPAM_RS 1071 ! #define IDC_RECOVER_RS 1072 #define IDC_HIDDEN 1076 #define IDC_FORWARD_BTN 1077 #define IDC_PAGE_PLACEHOLDER 1078 - #define IDC_EDIT2 1080 - #define IDC_EDIT3 1081 #define IDC_BUT_PREPARATION 1081 #define IDC_FOLDER_HAM 1083 --- 87,100 ---- #define IDC_USE_DELAY2 1065 #define IDC_TAB 1068 #define IDC_BACK_BTN 1069 ! #define IDC_BUT_WIZARD 1070 ! #define IDC_SHOW_DATA_FOLDER 1071 ! #define IDC_ABOUT_BTN 1072 ! #define IDC_BUT_RESET 1073 ! #define IDC_DEL_SPAM_RS 1074 ! #define IDC_RECOVER_RS 1075 #define IDC_HIDDEN 1076 #define IDC_FORWARD_BTN 1077 #define IDC_PAGE_PLACEHOLDER 1078 #define IDC_BUT_PREPARATION 1081 #define IDC_FOLDER_HAM 1083 *************** *** 111,115 **** #define _APS_NEXT_RESOURCE_VALUE 124 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1089 #define _APS_NEXT_SYMED_VALUE 101 #endif --- 108,112 ---- #define _APS_NEXT_RESOURCE_VALUE 124 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1090 #define _APS_NEXT_SYMED_VALUE 101 #endif Index: rcparser.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/rcparser.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rcparser.py 21 Aug 2003 13:09:37 -0000 1.8 --- rcparser.py 25 Aug 2003 17:28:09 -0000 1.9 *************** *** 157,161 **** i = int(lex.get_token()) self.ids[n] = i ! self.names[i] = n if self.next_id<=i: self.next_id = i+1 --- 157,164 ---- i = int(lex.get_token()) self.ids[n] = i ! if self.names.has_key(i): ! print "Duplicate id",i,"for",n,"is", self.names[i] ! else: ! self.names[i] = n if self.next_id<=i: self.next_id = i+1 From montanaro at users.sourceforge.net Mon Aug 25 13:08:59 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Mon Aug 25 15:09:52 2003 Subject: [Spambayes-checkins] spambayes/spambayes storage.py,1.22,1.23 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv13358 Modified Files: storage.py Log Message: push all prints to sys.stderr and include a comment for future authors to do the same Index: storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** storage.py 25 Aug 2003 15:31:39 -0000 1.22 --- storage.py 25 Aug 2003 19:08:57 -0000 1.23 *************** *** 47,50 **** --- 47,54 ---- # Foundation license. + ### Note to authors - please direct all prints to sys.stderr. In some + ### situations prints to sys.stdout will garble the message (e.g., in + ### hammiefilter). + __author__ = "Neale Pickett , \ Tim Stone " *************** *** 59,62 **** --- 63,67 ---- return not not val + import sys from spambayes import classifier from spambayes.Options import options *************** *** 97,101 **** if options.verbose: ! print 'Loading state from',self.db_name,'pickle' tempbayes = None --- 102,106 ---- if options.verbose: ! print >> sys.stderr, 'Loading state from',self.db_name,'pickle' tempbayes = None *************** *** 115,124 **** tempbayes.__getstate__()) if options.verbose: ! print '%s is an existing pickle, with %d ham and %d spam' \ % (self.db_name, self.nham, self.nspam) else: # new pickle if options.verbose: ! print self.db_name,'is a new pickle' self.wordinfo = {} self.nham = 0 --- 120,130 ---- tempbayes.__getstate__()) if options.verbose: ! print >> sys.stderr, ('%s is an existing pickle,' ! ' with %d ham and %d spam') \ % (self.db_name, self.nham, self.nspam) else: # new pickle if options.verbose: ! print >> sys.stderr, self.db_name,'is a new pickle' self.wordinfo = {} self.nham = 0 *************** *** 129,133 **** if options.verbose: ! print 'Persisting',self.db_name,'as a pickle' fp = open(self.db_name, 'wb') --- 135,139 ---- if options.verbose: ! print >> sys.stderr, 'Persisting',self.db_name,'as a pickle' fp = open(self.db_name, 'wb') *************** *** 155,159 **** if options.verbose: ! print 'Loading state from',self.db_name,'database' self.dbm = dbmstorage.open(self.db_name, self.mode) --- 161,165 ---- if options.verbose: ! print >> sys.stderr, 'Loading state from',self.db_name,'database' self.dbm = dbmstorage.open(self.db_name, self.mode) *************** *** 167,176 **** if options.verbose: ! print '%s is an existing database, with %d spam and %d ham' \ % (self.db_name, self.nspam, self.nham) else: # new database if options.verbose: ! print self.db_name,'is a new database' self.nspam = 0 self.nham = 0 --- 173,183 ---- if options.verbose: ! print >> sys.stderr, ('%s is an existing database,' ! ' with %d spam and %d ham') \ % (self.db_name, self.nspam, self.nham) else: # new database if options.verbose: ! print >> sys.stderr, self.db_name,'is a new database' self.nspam = 0 self.nham = 0 *************** *** 182,186 **** if options.verbose: ! print 'Persisting',self.db_name,'state in database' # Iterate over our changed word list. --- 189,193 ---- if options.verbose: ! print >> sys.stderr, 'Persisting',self.db_name,'state in database' # Iterate over our changed word list. *************** *** 306,310 **** (word,)) except Exception, e: ! print "error:", (e, word) raise rows = self.fetchall(c) --- 313,317 ---- (word,)) except Exception, e: ! print >> sys.stderr, "error:", (e, word) raise rows = self.fetchall(c) *************** *** 392,396 **** if options.verbose: ! print 'Loading state from',self.db_name,'database' self.db = psycopg.connect(self.db_name) --- 399,403 ---- if options.verbose: ! print >> sys.stderr, 'Loading state from',self.db_name,'database' self.db = psycopg.connect(self.db_name) *************** *** 408,417 **** self.nham = row["nham"] if options.verbose: ! print '%s is an existing database, with %d spam and %d ham' \ % (self.db_name, self.nspam, self.nham) else: # new database if options.verbose: ! print self.db_name,'is a new database' self.nspam = 0 self.nham = 0 --- 415,425 ---- self.nham = row["nham"] if options.verbose: ! print >> sys.stderr, ('%s is an existing database,' ! ' with %d spam and %d ham') \ % (self.db_name, self.nspam, self.nham) else: # new database if options.verbose: ! print >> sys.stderr, self.db_name,'is a new database' self.nspam = 0 self.nham = 0 *************** *** 462,466 **** if options.verbose: ! print 'Loading state from',self.db_name,'database' self.db = MySQLdb.connect(host=self.host, db=self.db_name, --- 470,474 ---- if options.verbose: ! print >> sys.stderr, 'Loading state from',self.db_name,'database' self.db = MySQLdb.connect(host=self.host, db=self.db_name, *************** *** 479,488 **** self.nham = int(row[2]) if options.verbose: ! print '%s is an existing database, with %d spam and %d ham' \ % (self.db_name, self.nspam, self.nham) else: # new database if options.verbose: ! print self.db_name,'is a new database' self.nspam = 0 self.nham = 0 --- 487,497 ---- self.nham = int(row[2]) if options.verbose: ! print >> sys.stderr, ('%s is an existing database,' ! ' with %d spam and %d ham') \ % (self.db_name, self.nspam, self.nham) else: # new database if options.verbose: ! print >> sys.stderr, self.db_name,'is a new database' self.nspam = 0 self.nham = 0 *************** *** 521,525 **** if options.verbose: ! print 'training with',message.key() self.bayes.learn(message.tokenize(), self.is_spam) --- 530,534 ---- if options.verbose: ! print >> sys.stderr, 'training with',message.key() self.bayes.learn(message.tokenize(), self.is_spam) *************** *** 535,539 **** if options.verbose: ! print 'untraining with',message.key() self.bayes.unlearn(message.tokenize(), self.is_spam) --- 544,548 ---- if options.verbose: ! print >> sys.stderr, 'untraining with',message.key() self.bayes.unlearn(message.tokenize(), self.is_spam) *************** *** 614,620 **** # We expect this to hit a fair few people, so warn them nicely, # rather than just printing the trackback. ! print """You do not have a dbm module available to use. You ! need to either use a pickle (see the FAQ), use Python 2.3 (or above), or ! install a dbm module such as bsddb (see http://sf.net/projects/pybsddb).""" import sys sys.exit() --- 623,630 ---- # We expect this to hit a fair few people, so warn them nicely, # rather than just printing the trackback. ! print >> sys.stderr, """\ ! You do not have a dbm module available to use. You need to either use a ! pickle (see the FAQ), use Python 2.3 (or above), or install a dbm module ! such as bsddb (see http://sf.net/projects/pybsddb).""" import sys sys.exit() From montanaro at users.sourceforge.net Mon Aug 25 13:26:10 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Mon Aug 25 15:26:14 2003 Subject: [Spambayes-checkins] website faq.txt,1.37,1.38 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv16019 Modified Files: faq.txt Log Message: refer to my latest VM training commands instead of those I abandoned a couple months ago. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** faq.txt 20 Aug 2003 01:12:16 -0000 1.37 --- faq.txt 25 Aug 2003 19:26:08 -0000 1.38 *************** *** 319,340 **** ~/.vm file:: ! (defun copy-to-spam () ! (interactive) (vm-save-message (expand-file-name "~/tmp/newspam")) ! (vm-undelete-message 1)) ! (defun copy-to-nonspam () ! (interactive) (vm-save-message (expand-file-name "~/tmp/newham")) ! (vm-undelete-message 1)) ! (define-key vm-mode-map "ls" 'copy-to-spam) ! (define-key vm-summary-mode-map "ls" 'copy-to-spam) ! (define-key vm-mode-map "lh" 'copy-to-nonspam) ! (define-key vm-summary-mode-map "lh" 'copy-to-nonspam) Typing "ls" will save a copy of the current message to ~/tmp/newspam and "lh" will save a copy of the current message to ~/tmp/newham. You can then ! use those files later as arguments to hammie.py for training. Users limited to POP3/IMAP communications to the server can use the POP3_ or --- 319,346 ---- ~/.vm file:: ! (defun train-as-spam () ! (interactive) ! (let ((vm-delete-after-saving nil)) (vm-save-message (expand-file-name "~/tmp/newspam")) ! (vm-add-message-labels "trained" 1)) ! (vm-pipe-message-to-command "hammiefilter.py -s >/dev/null" nil)) ! (defun train-as-nonspam () ! (interactive) ! (let ((vm-delete-after-saving nil)) (vm-save-message (expand-file-name "~/tmp/newham")) ! (vm-add-message-labels "trained" 1)) ! (vm-pipe-message-to-command "hammiefilter.py -g >/dev/null" nil)) ! (define-key vm-mode-map "ls" 'train-as-spam) ! (define-key vm-summary-mode-map "ls" 'train-as-spam) ! (define-key vm-mode-map "lh" 'train-as-nonspam) ! (define-key vm-summary-mode-map "lh" 'train-as-nonspam) Typing "ls" will save a copy of the current message to ~/tmp/newspam and "lh" will save a copy of the current message to ~/tmp/newham. You can then ! use those files later as arguments to hammie.py for training. Both commands ! also add a "trained" label to the message in question as a visual reminder ! that you've already added the message to your training database. Users limited to POP3/IMAP communications to the server can use the POP3_ or From richiehindle at users.sourceforge.net Mon Aug 25 17:57:21 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Mon Aug 25 19:57:25 2003 Subject: [Spambayes-checkins] spambayes pop3proxy.py,1.91,1.92 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv31409 Modified Files: pop3proxy.py Log Message: 743131: Specifying a POP3 server on the command line but no local port number (ie. no -l) now works again, defaulting to local port 110. Index: pop3proxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** pop3proxy.py 25 Aug 2003 09:00:33 -0000 1.91 --- pop3proxy.py 25 Aug 2003 23:57:18 -0000 1.92 *************** *** 799,802 **** --- 799,806 ---- elif len(args) == 2: state.servers = [(args[0], int(args[1]))] + + # Default to listening on port 110 for command-line-specified servers. + if len(args) > 0 and state.proxyPorts == []: + state.proxyPorts = [('', 110)] start(state=state) From anadelonbrin at users.sourceforge.net Mon Aug 25 17:57:25 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Aug 25 19:57:33 2003 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.16,1.17 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv31431/spambayes Modified Files: ProxyUI.py Log Message: Seems I missed committing this file yesterday. Apologies. Correct the options that are displayed in the pop3proxy ui. Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ProxyUI.py 19 Aug 2003 08:52:04 -0000 1.16 --- ProxyUI.py 25 Aug 2003 23:57:23 -0000 1.17 *************** *** 85,88 **** --- 85,89 ---- ('pop3proxy', 'cache_messages'), ('pop3proxy', 'no_cache_bulk_ham'), + ('pop3proxy', 'no_cache_large_messages'), ('html_ui', 'display_to'), ('html_ui', 'allow_remote_connections'), *************** *** 93,98 **** ('Headers', 'include_thermostat'), ('Headers', 'include_evidence'), - ('pop3proxy', 'add_mailid_to'), - ('pop3proxy', 'strip_incoming_mailids'), ('SMTP Proxy Options', None), ('smtpproxy', 'remote_servers'), --- 94,97 ---- *************** *** 108,112 **** ('Classifier', 'experimental_ham_spam_imbalance_adjustment'), ) - class ProxyUserInterface(UserInterface.UserInterface): --- 107,110 ---- From richiehindle at users.sourceforge.net Mon Aug 25 17:59:40 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Mon Aug 25 19:59:44 2003 Subject: [Spambayes-checkins] spambayes CHANGELOG.txt,1.10,1.11 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv31790 Modified Files: CHANGELOG.txt Log Message: 743131: Specifying a POP3 server on the pop3proxy command line but no local port number (ie. no -l) now works again, defaulting to local port 110. Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/CHANGELOG.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CHANGELOG.txt 19 Aug 2003 08:44:28 -0000 1.10 --- CHANGELOG.txt 25 Aug 2003 23:59:38 -0000 1.11 *************** *** 1,4 **** --- 1,5 ---- (Next Release) ============== + Richie Hindle 26/08/2003 Fix [ 743131 ] Specifying a POP3 server on the pop3proxy command line but no local port number (ie. no -l) now works again, defaulting to local port 110. Tony Meyer 19/08/2003 Allow @ and = in paths. Mark Hammond 18/08/2003 Improve the starting/stopping of the pop3proxy service From richiehindle at users.sourceforge.net Mon Aug 25 18:24:18 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Mon Aug 25 20:24:22 2003 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.17,1.18 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv2513 Modified Files: ProxyUI.py Log Message: Added a missing line break in the status pane on the Home page when there are no proxies configured. Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ProxyUI.py 25 Aug 2003 23:57:23 -0000 1.17 --- ProxyUI.py 26 Aug 2003 00:24:16 -0000 1.18 *************** *** 125,129 **** statusTable = self.html.statusTable.clone() if not state.servers: ! statusTable.proxyDetails = "No POP3 proxies running." content = (self._buildBox('Status and Configuration', 'status.gif', statusTable % stateDict)+ --- 125,129 ---- statusTable = self.html.statusTable.clone() if not state.servers: ! statusTable.proxyDetails = "No POP3 proxies running.
    " content = (self._buildBox('Status and Configuration', 'status.gif', statusTable % stateDict)+ From richiehindle at users.sourceforge.net Mon Aug 25 18:47:18 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Mon Aug 25 20:47:23 2003 Subject: [Spambayes-checkins] spambayes/spambayes message.py,1.32,1.33 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv5839 Modified Files: message.py Log Message: This now works again when there isn't a pre-existing message info DB. Index: message.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** message.py 25 Aug 2003 09:00:37 -0000 1.32 --- message.py 26 Aug 2003 00:47:16 -0000 1.33 *************** *** 113,116 **** --- 113,117 ---- try: self.dbm = dbmstorage.open(self.db_name, self.mode) + self.db = shelve.Shelf(self.dbm) except dbmstorage.error: # This probably means that we don't have a dbm module *************** *** 120,125 **** print "Warning: no dbm modules available for MessageInfoDB" self.dbm = self.db = None - if self.dbm: - self.db = shelve.Shelf(self.dbm) def store(self): --- 121,124 ---- From richiehindle at users.sourceforge.net Mon Aug 25 19:21:42 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Mon Aug 25 21:21:45 2003 Subject: [Spambayes-checkins] spambayes pop3proxy.py,1.92,1.93 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv10445 Modified Files: pop3proxy.py Log Message: Fixed [ 787251 ] Problem refreshing message list and [ 790051 ] Can't review messages _recreateState() didn't refresh the global state, just the one seen by the web UI. Index: pop3proxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** pop3proxy.py 25 Aug 2003 23:57:18 -0000 1.92 --- pop3proxy.py 26 Aug 2003 01:21:40 -0000 1.93 *************** *** 709,712 **** --- 709,713 ---- def _recreateState(): + global state state = State() state.buildServerStrings() From richiehindle at users.sourceforge.net Mon Aug 25 19:52:27 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Mon Aug 25 21:52:31 2003 Subject: [Spambayes-checkins] spambayes/spambayes Options.py,1.64,1.65 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv15085 Modified Files: Options.py Log Message: Spelling mistake: accomodate -> accommodate. Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Options.py 25 Aug 2003 09:00:36 -0000 1.64 --- Options.py 26 Aug 2003 01:52:25 -0000 1.65 *************** *** 697,701 **** filtering rules on a limited set of headers. These clients cannot test for the existence/value of an arbitrary header and filter mail ! based on that information. To accomodate these kind of mail clients, you can add "spam", "ham", or "unsure" to the recipient list. A filter rule can then use this to see if one of these words (followed --- 697,701 ---- filtering rules on a limited set of headers. These clients cannot test for the existence/value of an arbitrary header and filter mail ! based on that information. To accommodate these kind of mail clients, you can add "spam", "ham", or "unsure" to the recipient list. A filter rule can then use this to see if one of these words (followed From mhammond at users.sourceforge.net Mon Aug 25 20:26:16 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 22:26:20 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs opt_processors.py, 1.9, 1.10 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv19235 Modified Files: opt_processors.py Log Message: Include the default value for the option in the tooltip text. Make the edit/slider processor handle any range rather than the hardcoded 0.0-1.0 used by the probability slider. Index: opt_processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/opt_processors.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** opt_processors.py 24 Aug 2003 03:02:15 -0000 1.9 --- opt_processors.py 26 Aug 2003 02:26:13 -0000 1.10 *************** *** 27,31 **** def GetPopupHelpText(self, idFrom): ! return " ".join(self.option.doc().split()) # We override Init, and break it into 2 steps. --- 27,34 ---- def GetPopupHelpText(self, idFrom): ! doc = " ".join(self.option.doc().split()) ! if self.option.default_value: ! doc += " (the default value is %s)" % self.option.default_value ! return doc # We override Init, and break it into 2 steps. *************** *** 156,161 **** class EditNumberProcessor(OptionControlProcessor): ! def __init__(self, window, control_ids, option): self.slider_id = control_ids and control_ids[1] OptionControlProcessor.__init__(self, window, control_ids, option) --- 159,167 ---- class EditNumberProcessor(OptionControlProcessor): ! def __init__(self, window, control_ids, option, min_val = 0, max_val = 100, ticks = 100): self.slider_id = control_ids and control_ids[1] + self.min_val = min_val + self.max_val = max_val + self.ticks = ticks OptionControlProcessor.__init__(self, window, control_ids, option) *************** *** 173,178 **** if slider == lparam: slider_pos = win32gui.SendMessage(slider, commctrl.TBM_GETPOS, 0, 0) ! slider_pos = float(slider_pos) str_val = str(slider_pos) edit = self.GetControl() win32gui.SendMessage(edit, win32con.WM_SETTEXT, 0, str_val) --- 179,185 ---- if slider == lparam: slider_pos = win32gui.SendMessage(slider, commctrl.TBM_GETPOS, 0, 0) ! slider_pos = float(slider_pos) * self.max_val / self.ticks str_val = str(slider_pos) + print "Slider wants to set to", str_val edit = self.GetControl() win32gui.SendMessage(edit, win32con.WM_SETTEXT, 0, str_val) *************** *** 195,202 **** def InitSlider(self): slider = self.GetControl(self.slider_id) ! win32gui.SendMessage(slider, commctrl.TBM_SETRANGE, 0, MAKELONG(0, 100)) win32gui.SendMessage(slider, commctrl.TBM_SETLINESIZE, 0, 1) ! win32gui.SendMessage(slider, commctrl.TBM_SETPAGESIZE, 0, 5) ! win32gui.SendMessage(slider, commctrl.TBM_SETTICFREQ, 10, 0) def UpdateControl_FromValue(self): --- 202,212 ---- def InitSlider(self): slider = self.GetControl(self.slider_id) ! # xxx - this wont be right if min <> 0 :( ! assert self.min_val == 0, "sue me" ! win32gui.SendMessage(slider, commctrl.TBM_SETRANGE, 0, MAKELONG(0, self.ticks)) ! # sigh - these values may not be right win32gui.SendMessage(slider, commctrl.TBM_SETLINESIZE, 0, 1) ! win32gui.SendMessage(slider, commctrl.TBM_SETPAGESIZE, 0, self.ticks/20) ! win32gui.SendMessage(slider, commctrl.TBM_SETTICFREQ, self.ticks/10, 0) def UpdateControl_FromValue(self): *************** *** 207,214 **** def UpdateSlider_FromEdit(self): slider = self.GetControl(self.slider_id) try: # Get as float so we dont fail should the .0 be there, but # then convert to int as the slider only works with ints ! val = int(float(self.GetOptionValue())) except ValueError: return --- 217,231 ---- def UpdateSlider_FromEdit(self): slider = self.GetControl(self.slider_id) + # done as the user is typing into the edit control, so we must not + # complain here about invalid values as it is likely to only be + # temporarily invalid until they finish. try: # Get as float so we dont fail should the .0 be there, but # then convert to int as the slider only works with ints ! val = float(self.GetOptionValue()) ! # Convert it to our range. ! val *= float(self.ticks) / self.max_val ! print "Edit setting sliter to tick pos", val ! val = int(val) except ValueError: return *************** *** 222,227 **** str_val = buf[:nchars] val = float(str_val) ! if val < 0 or val > 100: ! raise ValueError, "Value must be between 0 and 100" self.SetOptionValue(val) --- 239,244 ---- str_val = buf[:nchars] val = float(str_val) ! if val < self.min_val or val > self.max_val: ! raise ValueError, "Value must be between %d and %d" % (self.min_val, self.max_val) self.SetOptionValue(val) From anadelonbrin at users.sourceforge.net Mon Aug 25 20:29:42 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Aug 25 22:29:44 2003 Subject: [Spambayes-checkins] spambayes smtpproxy.py,1.9,1.10 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv19754 Modified Files: smtpproxy.py Log Message: Don't convert unknown commands to upper case as this mucks about with passwords, which might be case sensitive. Index: smtpproxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/smtpproxy.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** smtpproxy.py 25 Aug 2003 01:40:40 -0000 1.9 --- smtpproxy.py 26 Aug 2003 02:29:40 -0000 1.10 *************** *** 213,217 **** else: splitCommand = self.request.strip().split(None, 1) ! self.command = splitCommand[0].upper() self.args = splitCommand[1:] --- 213,217 ---- else: splitCommand = self.request.strip().split(None, 1) ! self.command = splitCommand[0] self.args = splitCommand[1:] *************** *** 324,328 **** def onTransaction(self, command, args): ! handler = self.handlers.get(command, self.onUnknown) return handler(command, args) --- 324,328 ---- def onTransaction(self, command, args): ! handler = self.handlers.get(command.upper(), self.onUnknown) return handler(command, args) From mhammond at users.sourceforge.net Mon Aug 25 20:27:28 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 22:29:57 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs test_dialogs.py, 1.8, 1.9 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv19405 Modified Files: test_dialogs.py Log Message: Allow "-d" to dump the options after the dialog is closed, to help check the processors set the value correctly. Close the manager - not doing this prevented an existing instance of Outlook from shutting down once this had been run. Index: test_dialogs.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/test_dialogs.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_dialogs.py 24 Aug 2003 03:05:16 -0000 1.8 --- test_dialogs.py 26 Aug 2003 02:27:26 -0000 1.9 *************** *** 22,23 **** --- 22,28 ---- else: ShowDialog(0, mgr, mgr.config, idd) + if "-d" in sys.argv: + print "Dumping(but not saving) new manager configuration:" + print mgr.options.display() + print "-- end of configuration --" + mgr.Close() From mhammond at users.sourceforge.net Mon Aug 25 20:35:47 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 22:35:51 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs configuration.html, 1.7, 1.8 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs In directory sc8-pr-cvs1:/tmp/cvs-serv20493/docs Modified Files: configuration.html Log Message: The experimental 'timers' options got upgraded to the 'filter' section. Existing values should be migrated (but note you won't see the migration until the config is saved - ie, after the manager dialog is shown). New values are floating point seconds (and the migration also does the conversion from the old milli-seconds). I'm too nice :) Index: configuration.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/configuration.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** configuration.html 29 Jul 2003 01:16:28 -0000 1.7 --- configuration.html 26 Aug 2003 02:35:45 -0000 1.8 *************** *** 226,303 **** more appropriate one, so you will need to change these options later. - The following options are supported in this version
    -
      !
    1. Confirm the plugin is installed:
      Start Outlook, select your Inbox, then look at your Outlook toolbar.  Just below the standard Toolbar, you should see a new --- 114,118 ----
      !
    1. Confirm the plugin is installed:
      Start Outlook, select your Inbox, then look at your Outlook toolbar.  Just below the standard Toolbar, you should see a new *************** *** 122,127 **** appear, please see the troubleshooting guide.
    2. !
    3. Create Spam and Unsure folders
      Use the normal Outlook functions to create two new folders.  These can be named anything you like, and can appear anywhere in the folder --- 122,127 ---- appear, please see the troubleshooting guide.
    4. !
    5. Create ! Spam and Unsure folders
      Use the normal Outlook functions to create two new folders.  These can be named anything you like, and can appear anywhere in the folder *************** *** 129,133 **** something like Spam and Possible Spam.
    6. !
    7. Manually create initial training data
      Go through your Inbox, Deleted Items and any other folders likely to have spam, and move as much as possible --- 129,133 ---- something like Spam and Possible Spam.
    8. !
    9. Manually create initial training data
      Go through your Inbox, Deleted Items and any other folders likely to have spam, and move as much as possible *************** *** 136,140 **** of good messages we train on.  Don't worry too much about missing one or two spam - the system is likely to find them for you as we ! rescore your existing email.
      If your Inbox is so full of Spam you don't know where to start, you may like to create a temporary folder for the purposes of training your --- 136,140 ---- of good messages we train on.  Don't worry too much about missing one or two spam - the system is likely to find them for you as we ! rescore your existing email.

      If your Inbox is so full of Spam you don't know where to start, you may like to create a temporary folder for the purposes of training your *************** *** 142,148 **** new folder (roughly the same number as Spam you are training on is best) and nominate this temporary folder instead of your Inbox.  ! Once trained, you can dispose of this folder.
      !
    10. !
    11. Configure and Train SpamBayes
      Now we have our folders setup with some initial training data, we can configure the plugin.  From the SpamBayes --- 142,147 ---- new folder (roughly the same number as Spam you are training on is best) and nominate this temporary folder instead of your Inbox.  ! Once trained, you can dispose of this folder.
    12. !
    13. Configure and Train SpamBayes
      Now we have our folders setup with some initial training data, we can configure the plugin.  From the SpamBayes *************** *** 150,161 **** Manager...  This will display the main dialog, as shown to the right.
    14. !
    15. Select Train Now, and the training dialog, also shown to the right will appear.  You will need to select your Inbox as the folder for good messages, and your new Spam folder as the source of junk messages.  Ensure that Score messages after training is selected, so we can see how effective ! our Inbox cleanup was.
      !
    16. !
    17. Click on the Train Now button, and a progress indicator will be displayed as your messages are trained and scored.  When finished, close the training window to return --- 149,159 ---- Manager...  This will display the main dialog, as shown to the right.
    18. !
    19. Select Train Now, and the training dialog, also shown to the right will appear.  You will need to select your Inbox as the folder for good messages, and your new Spam folder as the source of junk messages.  Ensure that Score messages after training is selected, so we can see how effective ! our Inbox cleanup was.
    20. !
    21. Click on the Train Now button, and a progress indicator will be displayed as your messages are trained and scored.  When finished, close the training window to return *************** *** 164,169 ****
    Anti-Spam manager
    The SpamBayes Manager dialog

    --- 162,171 ----
    SpamBayes Toolbar
    !
    The SpamBayes Toolbar
    !
    ! SpamBayes manager
    The SpamBayes Manager dialog

    Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** addin.py 8 Aug 2003 17:13:18 -0000 1.90 --- addin.py 10 Aug 2003 07:26:48 -0000 1.91 *************** *** 429,432 **** --- 429,447 ---- self.manager.SaveBayesPostIncrementalTrain() + def ShowAbout(mgr): + mgr.ShowHtml("about.html") + + def ShowSpamBayesWebsite(mgr): + os.startfile("http://spambayes.sourceforge.net/") + def ShowFAQ(mgr): + os.startfile("http://spambayes.sourceforge.net/faq.html") + def ShowFAQ(mgr): + os.startfile("http://spambayes.sourceforge.net/faq.html") + def ShowBugTracker(mgr): + os.startfile("http://sourceforge.net/tracker/?group_id=61702&atid=498103") + + def ShowTroubleshooting(mgr): + mgr.ShowHtml("docs/troubleshooting.html") + # Event function fired from the "Show Clues" UI items. def ShowClues(mgr, explorer): *************** *** 789,792 **** --- 804,852 ---- Visible=True, Tag = "SpamBayesCommand.CheckVersion") + helpPopup = self._AddControl( + popup, + constants.msoControlPopup, + None, None, + Caption="Help", + TooltipText = "SpamBayes help documents", + Enabled = True, + Tag = "SpamBayesCommand.HelpPopup") + if helpPopup is not None: + helpPopup = CastTo(helpPopup, "CommandBarPopup") + self._AddControl(helpPopup, + constants.msoControlButton, + ButtonEvent, (ShowAbout, self.manager,), + Caption="About SpamBayes", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.Help.ShowAbout") + self._AddControl(helpPopup, + constants.msoControlButton, + ButtonEvent, (ShowTroubleshooting, self.manager,), + Caption="Troubleshooting Guide", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.Help.ShowTroubleshooting") + self._AddControl(helpPopup, + constants.msoControlButton, + ButtonEvent, (ShowSpamBayesWebsite, self.manager,), + Caption="SpamBayes Website", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.Help.ShowSpamBayes Website") + self._AddControl(helpPopup, + constants.msoControlButton, + ButtonEvent, (ShowFAQ, self.manager,), + Caption="Frequently Asked Questions", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.Help.ShowFAQ") + self._AddControl(helpPopup, + constants.msoControlButton, + ButtonEvent, (ShowBugTracker, self.manager,), + Caption="SpamBayes Bug Tracker", + Enabled=True, + Visible=True, + Tag = "SpamBayesCommand.Help.BugTacker") # If we are running from Python sources, enable a few extra items if not hasattr(sys, "frozen"): Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** manager.py 30 Jul 2003 03:22:51 -0000 1.69 --- manager.py 10 Aug 2003 07:26:48 -0000 1.70 *************** *** 7,10 **** --- 7,11 ---- import shutil import traceback + import operator import win32api, win32con, win32ui *************** *** 199,202 **** --- 200,204 ---- self.stats = Stats() self.outlook = outlook + self.dialog_parser = None import_early_core_spambayes_stuff() *************** *** 688,717 **** raise ! def ShowManager(self): ! def do_train(dlg): ! import train ! import dialogs.TrainingDialog ! d = dialogs.TrainingDialog.TrainingDialog(dlg.mgr, train.trainer) ! d.DoModal() ! def do_filter(dlg): ! import filter ! import dialogs.FilterDialog ! d = dialogs.FilterDialog.FilterNowDialog(dlg.mgr, filter.filterer) ! d.DoModal() ! def define_filter(dlg): ! import filter ! import dialogs.FilterDialog ! d = dialogs.FilterDialog.FilterArrivalsDialog(dlg.mgr, filter.filterer) ! d.DoModal() ! if dlg.mgr.addin is not None: ! dlg.mgr.addin.FiltersChanged() ! import dialogs.ManagerDialog ! d = dialogs.ManagerDialog.ManagerDialog(self, do_train, do_filter, define_filter) ! d.DoModal() # And re-save now, just incase Outlook dies on the way down. self.SaveConfig() _mgr = None --- 690,748 ---- raise ! def GetDisabledReason(self): ! # Gets the reason why the plugin can not be enabled. ! # If return is None, then it can be enabled (and indeed may be!) ! # Otherwise return is the string reason ! nspam = self.bayes.nspam ! nham = self.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) ! if not ok_to_enable: ! return "You must define the folder to receive your certain spam" ! return None ! def ShowManager(self): ! import dialogs ! # Need to get the plugin hwnd ! dialogs.ShowDialog(0, self, "IDD_MANAGER") # And re-save now, just incase Outlook dies on the way down. self.SaveConfig() + + def ShowHtml(self,fileName): + """Displays the main SpamBayes documentation in your Web browser""" + import sys, os + if hasattr(sys, "frozen"): + # Same directory as to the executable. + fname = os.path.join(os.path.dirname(sys.argv[0]), + fileName) + else: + # (ie, main Outlook2000) dir + fname = os.path.join(os.path.dirname(__file__), + fileName) + fname = os.path.abspath(fname) + from dialogs import SetWaitCursor + if os.path.isfile(fname): + SetWaitCursor(1) + os.startfile(fname) + SetWaitCursor(0) + else: + print "Cant find ",fileName," - fix messagebox" + #self.MessageBox("Can't find "+fileName) _mgr = None Index: train.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/train.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** train.py 15 May 2003 22:52:00 -0000 1.27 --- train.py 10 Aug 2003 07:26:49 -0000 1.28 *************** *** 98,103 **** # Called back from the dialog to do the actual training. ! def trainer(mgr, progress, rebuild, rescore = True): config = mgr.config if not config.training.ham_folder_ids or not config.training.spam_folder_ids: --- 98,105 ---- # Called back from the dialog to do the actual training. ! def trainer(mgr, progress): config = mgr.config + rebuild = config.training.rebuild + rescore = config.training.rescore if not config.training.ham_folder_ids or not config.training.spam_folder_ids: From mhammond at users.sourceforge.net Sun Aug 10 01:26:52 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 03:26:59 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources .cvsignore, 1.1, 1.2 __init__.py, 1.1, 1.2 dialogs.h, 1.1, 1.2 dialogs.rc, 1.1, 1.2 folders.bmp, 1.1, 1.2 rc2py.py, 1.1, 1.2 rcparser.py, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv22259/dialogs/resources Added Files: .cvsignore __init__.py dialogs.h dialogs.rc folders.bmp rc2py.py rcparser.py Log Message: Merge in outlook-dialog-branch. Thanks everyone. From mhammond at users.sourceforge.net Sun Aug 10 01:26:52 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 03:27:02 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs async_processor.py, 1.1, 1.2 dialog_map.py, 1.1, 1.2 dlgcore.py, 1.1, 1.2 dlgutils.py, 1.1, 1.2 opt_processors.py, 1.1, 1.2 processors.py, 1.1, 1.2 test_dialogs.py, 1.1, 1.2 FolderSelector.py, 1.20, 1.21 __init__.py, 1.2, 1.3 AsyncDialog.py, 1.8, NONE DialogGlobals.py, 1.1, NONE FilterDialog.py, 1.20, NONE ManagerDialog.py, 1.10, NONE TrainingDialog.py, 1.13, NONE Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv22259/dialogs Modified Files: FolderSelector.py __init__.py Added Files: async_processor.py dialog_map.py dlgcore.py dlgutils.py opt_processors.py processors.py test_dialogs.py Removed Files: AsyncDialog.py DialogGlobals.py FilterDialog.py ManagerDialog.py TrainingDialog.py Log Message: Merge in outlook-dialog-branch. Thanks everyone. Index: FolderSelector.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** FolderSelector.py 18 Jun 2003 13:29:46 -0000 1.20 --- FolderSelector.py 10 Aug 2003 07:26:49 -0000 1.21 *************** *** 1,11 **** from __future__ import generators ! from pywin.mfc import dialog import win32con import commctrl - import win32ui import win32api ! from DialogGlobals import * try: --- 1,18 ---- from __future__ import generators ! import sys, os import win32con import commctrl import win32api + import win32gui ! import struct, array ! ! import dlgutils ! ! def INDEXTOSTATEIMAGEMASK(i): # from new commctrl.h ! return i << 12 ! IIL_UNCHECKED = 1 ! IIL_CHECKED = 2 try: *************** *** 56,60 **** def _BuildFoldersMAPI(manager, folder_spec): # This is called dynamically as folders are expanded. ! win32ui.DoWaitCursor(1) folder = manager.message_store.GetFolder(folder_spec.folder_id).OpenEntry() # Get the hierarchy table for it. --- 63,67 ---- def _BuildFoldersMAPI(manager, folder_spec): # This is called dynamically as folders are expanded. ! dlgutils.SetWaitCursor(1) folder = manager.message_store.GetFolder(folder_spec.folder_id).OpenEntry() # Get the hierarchy table for it. *************** *** 94,98 **** print "** Unable to open child folder - ignoring" print details ! win32ui.DoWaitCursor(0) return children --- 101,105 ---- print "** Unable to open child folder - ignoring" print details ! dlgutils.SetWaitCursor(0) return children *************** *** 123,168 **** return root ######################################################################### ## The dialog itself ######################################################################### ! # IDs for controls we use. ! IDC_STATUS1 = win32ui.IDC_PROMPT1 ! IDC_STATUS2 = win32ui.IDC_PROMPT2 ! IDC_BUTTON_SEARCHSUB = win32ui.IDC_BUTTON1 ! IDC_BUTTON_CLEARALL = win32ui.IDC_BUTTON2 ! IDC_LIST_FOLDERS = win32ui.IDC_LIST1 ! ! class FolderSelector(dialog.Dialog): ! style = (win32con.DS_MODALFRAME | ! win32con.WS_POPUP | ! win32con.WS_VISIBLE | ! win32con.WS_CAPTION | ! win32con.WS_SYSMENU | ! win32con.DS_SETFONT) ! cs = win32con.WS_CHILD | win32con.WS_VISIBLE ! treestyle = (cs | ! win32con.WS_BORDER | ! commctrl.TVS_HASLINES | ! commctrl.TVS_LINESATROOT | ! commctrl.TVS_CHECKBOXES | ! commctrl.TVS_HASBUTTONS | ! commctrl.TVS_DISABLEDRAGDROP | ! commctrl.TVS_SHOWSELALWAYS) ! dt = [ ! # Dialog itself. ! ["", (0, 0, 247, 215), style, None, (8, "MS Sans Serif")], ! # Children ! [STATIC, "&Folders:", -1, (7, 7, 47, 9), cs ], ! ["SysTreeView32", None, IDC_LIST_FOLDERS, (7, 21, 172, 140), treestyle | win32con.WS_TABSTOP], ! [BUTTON, '', IDC_BUTTON_SEARCHSUB, (7, 167, 126, 9), cs | win32con.BS_AUTOCHECKBOX | win32con.WS_TABSTOP], ! [STATIC, "", IDC_STATUS1, (7, 180, 220, 9), cs ], ! [STATIC, "", IDC_STATUS2, (7, 194, 220, 9), cs ], ! [BUTTON, 'OK', win32con.IDOK, (190, 21, 50, 14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP], ! [BUTTON, 'Cancel', win32con.IDCANCEL, (190, 39, 50, 14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP], ! [BUTTON, 'C&lear All', IDC_BUTTON_CLEARALL, (190, 58, 50, 14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP], ! ] ! ! def __init__ (self, manager, selected_ids=None, single_select=False, checkbox_state=False, --- 130,205 ---- return root + # Helpers for the ugly win32 structure packing/unpacking + def _GetMaskAndVal(val, default, mask, flag): + if val is None: + return mask, default + else: + mask |= flag + return mask, val + + def PackTVINSERTSTRUCT(parent, insertAfter, tvitem): + tvitem_buf, extra = PackTVITEM(*tvitem) + tvitem_buf = tvitem_buf.tostring() + format = "ii%ds" % len(tvitem_buf) + return struct.pack(format, parent, insertAfter, tvitem_buf), extra + + def PackTVITEM(hitem, state, stateMask, text, image, selimage, citems, param): + extra = [] # objects we must keep references to + mask = 0 + mask, hitem = _GetMaskAndVal(hitem, 0, mask, commctrl.TVIF_HANDLE) + mask, state = _GetMaskAndVal(state, 0, mask, commctrl.TVIF_STATE) + if not mask & commctrl.TVIF_STATE: + stateMask = 0 + mask, text = _GetMaskAndVal(text, None, mask, commctrl.TVIF_TEXT) + mask, image = _GetMaskAndVal(image, 0, mask, commctrl.TVIF_IMAGE) + mask, selimage = _GetMaskAndVal(selimage, 0, mask, commctrl.TVIF_SELECTEDIMAGE) + mask, citems = _GetMaskAndVal(citems, 0, mask, commctrl.TVIF_CHILDREN) + mask, param = _GetMaskAndVal(param, 0, mask, commctrl.TVIF_PARAM) + if text is None: + text_addr = text_len = 0 + else: + text_buffer = array.array("c", text+"\0") + extra.append(text_buffer) + text_addr, text_len = text_buffer.buffer_info() + format = "iiiiiiiiii" + buf = struct.pack(format, + mask, hitem, + state, stateMask, + text_addr, text_len, # text + image, selimage, + citems, param) + return array.array("c", buf), extra + + def UnpackLVITEM(buffer): + item_mask, item_hItem, item_state, item_stateMask, \ + item_textptr, item_cchText, item_image, item_selimage, \ + item_cChildren, item_param = struct.unpack("10i", buffer) + + if item_textptr: + text = win32gui.PyGetString(item_textptr) + else: + text = None + # Todo - translate items without the mask bit set to None + return item_hItem, item_state, item_stateMask, \ + text, item_image, item_selimage, \ + item_cChildren, item_param + + def UnpackLVNOTIFY(lparam): + format = "iiii40s40s" + buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) + hwndFrom, id, code, action, buf_old, buf_new \ + = struct.unpack(format, buf) + item_old = UnpackLVITEM(buf_old) + item_new = UnpackLVITEM(buf_new) + return hwndFrom, id, code, action, item_old, item_new + ######################################################################### ## The dialog itself ######################################################################### + import dlgcore ! FolderSelector_Parent = dlgcore.TooltipDialog ! class FolderSelector(FolderSelector_Parent): ! def __init__ (self, parent, manager, selected_ids=None, single_select=False, checkbox_state=False, *************** *** 174,182 **** PR_IPM_OUTBOX_ENTRYID) ): assert not single_select or selected_ids is None or len(selected_ids)<=1 - dialog.Dialog.__init__ (self, self.dt) self.single_select = single_select self.next_item_id = 1 self.item_map = {} self.select_desc_noun = desc_noun --- 211,221 ---- PR_IPM_OUTBOX_ENTRYID) ): + FolderSelector_Parent.__init__(self, parent, manager.dialog_parser, "IDD_FOLDER_SELECTOR") assert not single_select or selected_ids is None or len(selected_ids)<=1 self.single_select = single_select self.next_item_id = 1 self.item_map = {} + self.timer_id = None + self.imageList = None self.select_desc_noun = desc_noun *************** *** 227,231 **** mask = commctrl.TVIS_STATEIMAGEMASK item_id = self._MakeItemParam(child) ! hitem = self.list.InsertItem(hParent, 0, (None, state, --- 266,270 ---- mask = commctrl.TVIS_STATEIMAGEMASK item_id = self._MakeItemParam(child) ! insert_buf, extras = PackTVINSERTSTRUCT(hParent, 0, (None, state, *************** *** 236,243 **** cItems, item_id)) # If this folder is in the list of ones we need to expand # to show pre-selected items, then force expand now. if self.InIDs(child.folder_id, self.expand_ids): ! self.list.Expand(hitem, commctrl.TVE_EXPAND) # If single-select, and this is ours, select it # (multi-select uses check-boxes, not selection) --- 275,287 ---- cItems, item_id)) + hitem = win32gui.SendMessage(self.list, commctrl.TVM_INSERTITEM, + 0, insert_buf) + # If this folder is in the list of ones we need to expand # to show pre-selected items, then force expand now. if self.InIDs(child.folder_id, self.expand_ids): ! win32gui.SendMessage(self.list, ! commctrl.TVM_EXPAND, ! commctrl.TVE_EXPAND, hitem) # If single-select, and this is ours, select it # (multi-select uses check-boxes, not selection) *************** *** 245,249 **** self.selected_ids and self.InIDs(child.folder_id, self.selected_ids)): ! self.list.SelectItem(hitem) def _DetermineFoldersToExpand(self): --- 289,295 ---- self.selected_ids and self.InIDs(child.folder_id, self.selected_ids)): ! win32gui.SendMessage(self.list, ! commctrl.TVM_SELECTITEM, ! commctrl.TVGN_CARET, hitem) def _DetermineFoldersToExpand(self): *************** *** 259,270 **** return folders_to_expand def _YieldChildren(self, h): try: ! h = self.list.GetNextItem(h, commctrl.TVGN_CHILD) ! except win32ui.error: ! h = None ! while h is not None: ! info = self.list.GetItem(h) ! spec = self.item_map[info[7]] yield info, spec # Check children --- 305,326 ---- return folders_to_expand + def _GetLVItem(self, h): + text_buffer = "\0" * 1024 + buffer, extra = PackTVITEM(h, 0, 0, text_buffer, None, None, None, -1) + win32gui.SendMessage(self.list, commctrl.TVM_GETITEM, + 0, buffer.buffer_info()[0]) + return UnpackLVITEM(buffer.tostring()) + def _YieldChildren(self, h): try: ! h = win32gui.SendMessage(self.list, commctrl.TVM_GETNEXTITEM, ! commctrl.TVGN_CHILD, h) ! except win32gui.error: ! h = 0 ! while h: ! info = self._GetLVItem(h) ! item_param = info[-1] ! spec = self.item_map[item_param] ! yield info, spec # Check children *************** *** 272,277 **** yield info, spec try: ! h = self.list.GetNextItem(h, commctrl.TVGN_NEXT) ! except win32ui.error: h = None --- 328,334 ---- yield info, spec try: ! h = win32gui.SendMessage(self.list, commctrl.TVM_GETNEXTITEM, ! commctrl.TVGN_NEXT, h) ! except win32gui.error: h = None *************** *** 284,291 **** # selected state. try: ! h = self.list.GetSelectedItem() ! except win32ui.error: return ! info = self.list.GetItem(h) spec = self.item_map[info[7]] yield info, spec --- 341,349 ---- # selected state. try: ! h = win32gui.SendMessage(self.list, commctrl.TVM_GETSELECTEDITEM, ! commctrl.TVGN_CARET, h) ! except win32gui.error: return ! info = self._GetLVItem(h) spec = self.item_map[info[7]] yield info, spec *************** *** 297,337 **** yield info, spec ! def OnInitDialog (self): caption = "%s folder" % (self.select_desc_noun,) if not self.single_select: caption += "(s)" ! self.SetWindowText(caption) ! self.SetDlgItemText(IDC_BUTTON_SEARCHSUB, self.checkbox_text) if self.checkbox_state is None: ! self.GetDlgItem(IDC_BUTTON_SEARCHSUB).ShowWindow(win32con.SW_HIDE) else: ! self.GetDlgItem(IDC_BUTTON_SEARCHSUB).SetCheck(self.checkbox_state) ! self.list = self.GetDlgItem(win32ui.IDC_LIST1) ! ! self.HookNotify(self.OnTreeItemExpanding, commctrl.TVN_ITEMEXPANDING) ! self.HookNotify(self.OnTreeItemSelChanged, commctrl.TVN_SELCHANGED) ! self.HookNotify(self.OnTreeItemClick, commctrl.NM_CLICK) ! self.HookNotify(self.OnTreeItemDoubleClick, commctrl.NM_DBLCLK) ! self.HookCommand(self.OnClearAll, IDC_BUTTON_CLEARALL) ! bitmapID = win32ui.IDB_HIERFOLDERS bitmapMask = win32api.RGB(0,0,255) ! self.imageList = win32ui.CreateImageList(bitmapID, 16, 0, bitmapMask) ! self.list.SetImageList(self.imageList, commctrl.LVSIL_NORMAL) if self.single_select: # Remove the checkbox style from the list for single-selection ! style = win32api.GetWindowLong(self.list.GetSafeHwnd(), win32con.GWL_STYLE) style = style & ~commctrl.TVS_CHECKBOXES ! win32api.SetWindowLong(self.list.GetSafeHwnd(), win32con.GWL_STYLE, style) # Hide "clear all" ! self.GetDlgItem(IDC_BUTTON_CLEARALL).ShowWindow(win32con.SW_HIDE) # Extended MAPI version of the tree. # Build list of all ids to expand - ie, list includes all # selected folders, and all parents. ! win32ui.DoWaitCursor(1) self.expand_ids = self._DetermineFoldersToExpand() tree = BuildFolderTreeMAPI(self.manager.message_store.session, self.exclude_prop_ids) --- 355,413 ---- yield info, spec ! def GetSelectedIDs(self): ! try: ! self.GetDlgItem("IDC_LIST_FOLDERS") ! except win32gui.error: # dialog dead! ! return self.selected_ids, self.checkbox_state ! ret = [] ! for info, spec in self._YieldCheckedChildren(): ! ret.append(spec.folder_id) ! check = win32gui.SendMessage(self.GetDlgItem("IDC_BUT_SEARCHSUB"), ! win32con.BM_GETCHECK, 0, 0) ! return ret, check != 0 ! ! # Message processing ! # def GetMessageMap(self): ! ! def OnInitDialog (self, hwnd, msg, wparam, lparam): ! FolderSelector_Parent.OnInitDialog(self, hwnd, msg, wparam, lparam) caption = "%s folder" % (self.select_desc_noun,) if not self.single_select: caption += "(s)" ! win32gui.SendMessage(hwnd, win32con.WM_SETTEXT, 0, caption) ! self.SetDlgItemText("IDC_BUT_SEARCHSUB", self.checkbox_text) ! child = self.GetDlgItem("IDC_BUT_SEARCHSUB") if self.checkbox_state is None: ! win32gui.ShowWindow(child, win32con.SW_HIDE) else: ! win32gui.SendMessage(child, win32con.BM_SETCHECK, self.checkbox_state) ! self.list = self.GetDlgItem("IDC_LIST_FOLDERS") ! fname = os.path.join(os.path.dirname(__file__), "resources/folders.bmp") bitmapMask = win32api.RGB(0,0,255) ! self.imageList = win32gui.ImageList_LoadImage(0, fname, ! 16, 0, ! bitmapMask, ! win32con.IMAGE_BITMAP, ! win32con.LR_LOADFROMFILE) ! win32gui.SendMessage( self.list, ! commctrl.TVM_SETIMAGELIST, ! commctrl.TVSIL_NORMAL, self.imageList ) if self.single_select: # Remove the checkbox style from the list for single-selection ! style = win32api.GetWindowLong(self.list, win32con.GWL_STYLE) style = style & ~commctrl.TVS_CHECKBOXES ! win32api.SetWindowLong(self.list, win32con.GWL_STYLE, style) # Hide "clear all" ! child = self.GetDlgItem("IDC_BUT_CLEARALL") ! win32gui.ShowWindow(child, win32con.SW_HIDE) # Extended MAPI version of the tree. # Build list of all ids to expand - ie, list includes all # selected folders, and all parents. ! dlgutils.SetWaitCursor(1) self.expand_ids = self._DetermineFoldersToExpand() tree = BuildFolderTreeMAPI(self.manager.message_store.session, self.exclude_prop_ids) *************** *** 340,358 **** self.expand_ids = [] # Only use this while creating dialog. self._UpdateStatus() ! win32ui.DoWaitCursor(0) - return dialog.Dialog.OnInitDialog (self) ! def OnDestroy(self, msg): self.item_map = None ! return dialog.Dialog.OnDestroy(self, msg) ! def OnClearAll(self, id, code): if code == win32con.BN_CLICKED: ! for info, spec in self._YieldCheckedChildren(): ! state = INDEXTOSTATEIMAGEMASK(IIL_UNCHECKED) ! mask = commctrl.TVIS_STATEIMAGEMASK ! self.list.SetItemState(info[0], state, mask) ! self._UpdateStatus() def _DoUpdateStatus(self, id, timeval): --- 416,453 ---- self.expand_ids = [] # Only use this while creating dialog. self._UpdateStatus() ! dlgutils.SetWaitCursor(0) ! def OnDestroy(self, hwnd, msg, wparam, lparam): ! import timer ! if self.timer_id is not None: ! timer.kill_timer(self.timer_id) self.item_map = None ! win32gui.ImageList_Destroy(self.imageList) ! FolderSelector_Parent.OnDestroy(self, hwnd, msg, wparam, lparam) ! def OnCommand(self, hwnd, msg, wparam, lparam): ! FolderSelector_Parent.OnCommand(self, hwnd, msg, wparam, lparam) ! id = win32api.LOWORD(wparam) ! id_name = self._GetIDName(id) ! code = win32api.HIWORD(wparam) ! if code == win32con.BN_CLICKED: ! # Button clicks ! if id == win32con.IDOK: ! self.selected_ids, self.checkbox_state = self.GetSelectedIDs() ! win32gui.EndDialog(hwnd, id) ! elif id == win32con.IDCANCEL: ! win32gui.EndDialog(hwnd, id) ! elif id_name == "IDC_BUT_CLEARALL": ! for info, spec in self._YieldCheckedChildren(): ! state = INDEXTOSTATEIMAGEMASK(IIL_UNCHECKED) ! mask = commctrl.TVIS_STATEIMAGEMASK ! buf, extra = PackTVITEM(info[0], state, mask, ! None, None, None, None, None) ! win32gui.SendMessage(self.list, commctrl.TVM_SETITEM, ! 0, buf) ! ! self._UpdateStatus() def _DoUpdateStatus(self, id, timeval): *************** *** 370,428 **** if num_checked != 1: status_string += "s" ! self.SetDlgItemText(IDC_STATUS1, status_string) ! self.SetDlgItemText(IDC_STATUS2, "; ".join(names)) finally: import timer timer.kill_timer(id) def _UpdateStatus(self): import timer ! timer.set_timer (0, self._DoUpdateStatus) ! ! def OnOK(self): ! self.selected_ids, self.checkbox_state = self.GetSelectedIDs() ! return self._obj_.OnOK() ! def OnCancel(self): ! return self._obj_.OnCancel() ! ! def OnTreeItemDoubleClick(self,(hwndFrom, idFrom, code), extra): ! if idFrom != IDC_LIST_FOLDERS: return None ! if self.single_select: # Only close on double-click for single-select ! self.OnOK() ! return 0 ! ! def OnTreeItemClick(self,(hwndFrom, idFrom, code), extra): ! if idFrom != IDC_LIST_FOLDERS: return None ! self._UpdateStatus() ! return 0 ! ! def OnTreeItemExpanding(self,(hwndFrom, idFrom, code), extra): ! if idFrom != IDC_LIST_FOLDERS: return None ! action, itemOld, itemNew, pt = extra ! if action == 1: return 0 # contracting, not expanding ! ! itemHandle = itemNew[0] ! info = self.list.GetItem(itemHandle) ! folderSpec = self.item_map[info[7]] ! if folderSpec.children is None: ! folderSpec.children = _BuildFoldersMAPI(self.manager, folderSpec) ! self._InsertSubFolders(itemHandle, folderSpec) ! return 0 ! ! def OnTreeItemSelChanged(self,(hwndFrom, idFrom, code), extra): ! if idFrom != IDC_LIST_FOLDERS: return None ! action, itemOld, itemNew, pt = extra ! self._UpdateStatus() ! return 1 ! def GetSelectedIDs(self): ! try: ! self.GetDlgItem(IDC_LIST_FOLDERS) ! except win32ui.error: # dialog dead! ! return self.selected_ids, self.checkbox_state ! ret = [] ! for info, spec in self._YieldCheckedChildren(): ! ret.append(spec.folder_id) ! return ret, self.GetDlgItem(IDC_BUTTON_SEARCHSUB).GetCheck() != 0 def Test(): --- 465,506 ---- if num_checked != 1: status_string += "s" ! self.SetDlgItemText("IDC_STATUS1", status_string) ! self.SetDlgItemText("IDC_STATUS2", "; ".join(names)) finally: import timer + self.timer_id = None timer.kill_timer(id) def _UpdateStatus(self): import timer ! if self.timer_id is not None: ! timer.kill_timer(self.timer_id) ! self.timer_id = timer.set_timer (0, self._DoUpdateStatus) ! def OnNotify(self, msg, hwnd, wparam, lparam): ! FolderSelector_Parent.OnNotify(self, hwnd, msg, wparam, lparam) ! format = "iii" ! buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) ! hwndFrom, id, code = struct.unpack(format, buf) ! code += 0x4f0000 # hrm - wtf - commctrl uses this, and it works with mfc. *sigh* ! id_name = self._GetIDName(id) ! if id_name == "IDC_LIST_FOLDERS": ! if code == commctrl.NM_CLICK: ! self._UpdateStatus() ! elif code == commctrl.NM_DBLCLK: ! if self.single_select: # Only close on double-click for single-select ! self.OnOK() ! elif code == commctrl.TVN_ITEMEXPANDING: ! ignore, ignore, ignore, action, itemOld, itemNew = \ ! UnpackLVNOTIFY(lparam) ! if action == 1: return 0 # contracting, not expanding ! itemHandle = itemNew[0] ! info = itemNew ! folderSpec = self.item_map[info[7]] ! if folderSpec.children is None: ! folderSpec.children = _BuildFoldersMAPI(self.manager, folderSpec) ! self._InsertSubFolders(itemHandle, folderSpec) ! elif code == commctrl.TVN_SELCHANGED: ! self._UpdateStatus() def Test(): *************** *** 430,438 **** sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))) import manager ids = [] ! d=FolderSelector(manager.GetManager(), ids, single_select = False) ! d.DoModal() ids, include_sub = d.GetSelectedIDs() ! d=FolderSelector(manager.GetManager(), ids, single_select = False) d.DoModal() --- 508,523 ---- sys.path.append(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))) import manager + mgr = manager.GetManager() + if mgr.dialog_parser is None: + import dialogs + mgr.dialog_parser = dialogs.LoadDialogs() + ids = [] ! d=FolderSelector(0, mgr, ids, single_select = False) ! if d.DoModal() != win32con.IDOK: ! print "Cancelled" ! return ids, include_sub = d.GetSelectedIDs() ! d=FolderSelector(0, mgr, ids, single_select = False, checkbox_state = include_sub) d.DoModal() Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** __init__.py 19 Oct 2002 18:14:01 -0000 1.2 --- __init__.py 10 Aug 2003 07:26:49 -0000 1.3 *************** *** 1,2 **** --- 1,29 ---- # This package defines dialog boxes used by the main # SpamBayes Outlook 2k integration code. + + def LoadDialogs(rc_file = "dialogs.rc"): + import os + from resources import rcparser + if not os.path.isabs(rc_file): + rc_file = os.path.join( os.path.dirname( rcparser.__file__ ), rc_file) + return rcparser.ParseDialogs(rc_file) + + def ShowDialog(parent, manager, idd): + """Displays another dialog""" + if manager.dialog_parser is None: + manager.dialog_parser = LoadDialogs() + import dialog_map + commands = dialog_map.dialog_map[idd] + if not parent: + import win32gui + try: + parent = win32gui.GetActiveWindow() + except win32gui.error: + pass + + import dlgcore + dlg = dlgcore.ProcessorDialog(parent, manager, idd, commands) + dlg.DoModal() + + import dlgutils + SetWaitCursor = dlgutils.SetWaitCursor --- AsyncDialog.py DELETED --- --- DialogGlobals.py DELETED --- --- FilterDialog.py DELETED --- --- ManagerDialog.py DELETED --- --- TrainingDialog.py DELETED --- From mhammond at users.sourceforge.net Sun Aug 10 01:26:53 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 03:27:04 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/installer installation_notes.rtf, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/installer In directory sc8-pr-cvs1:/tmp/cvs-serv22259/installer Modified Files: installation_notes.rtf Log Message: Merge in outlook-dialog-branch. Thanks everyone. Index: installation_notes.rtf =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/installer/installation_notes.rtf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsrl3L0g and /tmp/cvsW1QwOn differ From mhammond at users.sourceforge.net Sun Aug 10 01:26:52 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 03:27:07 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs/images manager-select.jpg, 1.1, 1.2 manager.jpg, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs/images In directory sc8-pr-cvs1:/tmp/cvs-serv22259/docs/images Modified Files: manager.jpg Added Files: manager-select.jpg Log Message: Merge in outlook-dialog-branch. Thanks everyone. Index: manager.jpg =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/images/manager.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvshI5gSa and /tmp/cvsGZTQlb differ From mhammond at users.sourceforge.net Sun Aug 10 01:26:52 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 03:27:09 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/images .cvsignore, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/images In directory sc8-pr-cvs1:/tmp/cvs-serv22259/images Added Files: .cvsignore Log Message: Merge in outlook-dialog-branch. Thanks everyone. From mhammond at users.sourceforge.net Sun Aug 10 01:49:14 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 03:49:17 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.91, 1.92 manager.py, 1.70, 1.71 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv24679 Modified Files: addin.py manager.py Log Message: Clean up the help functions a little, and extend manager.ShowHTML to actually handle URLs. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** addin.py 10 Aug 2003 07:26:48 -0000 1.91 --- addin.py 10 Aug 2003 07:49:11 -0000 1.92 *************** *** 429,447 **** self.manager.SaveBayesPostIncrementalTrain() - def ShowAbout(mgr): - mgr.ShowHtml("about.html") - - def ShowSpamBayesWebsite(mgr): - os.startfile("http://spambayes.sourceforge.net/") - def ShowFAQ(mgr): - os.startfile("http://spambayes.sourceforge.net/faq.html") - def ShowFAQ(mgr): - os.startfile("http://spambayes.sourceforge.net/faq.html") - def ShowBugTracker(mgr): - os.startfile("http://sourceforge.net/tracker/?group_id=61702&atid=498103") - - def ShowTroubleshooting(mgr): - mgr.ShowHtml("docs/troubleshooting.html") - # Event function fired from the "Show Clues" UI items. def ShowClues(mgr, explorer): --- 429,432 ---- *************** *** 814,852 **** if helpPopup is not None: helpPopup = CastTo(helpPopup, "CommandBarPopup") ! self._AddControl(helpPopup, ! constants.msoControlButton, ! ButtonEvent, (ShowAbout, self.manager,), ! Caption="About SpamBayes", ! Enabled=True, ! Visible=True, ! Tag = "SpamBayesCommand.Help.ShowAbout") ! self._AddControl(helpPopup, ! constants.msoControlButton, ! ButtonEvent, (ShowTroubleshooting, self.manager,), ! Caption="Troubleshooting Guide", ! Enabled=True, ! Visible=True, ! Tag = "SpamBayesCommand.Help.ShowTroubleshooting") ! self._AddControl(helpPopup, ! constants.msoControlButton, ! ButtonEvent, (ShowSpamBayesWebsite, self.manager,), ! Caption="SpamBayes Website", ! Enabled=True, ! Visible=True, ! Tag = "SpamBayesCommand.Help.ShowSpamBayes Website") ! self._AddControl(helpPopup, ! constants.msoControlButton, ! ButtonEvent, (ShowFAQ, self.manager,), ! Caption="Frequently Asked Questions", ! Enabled=True, ! Visible=True, ! Tag = "SpamBayesCommand.Help.ShowFAQ") ! self._AddControl(helpPopup, ! constants.msoControlButton, ! ButtonEvent, (ShowBugTracker, self.manager,), ! Caption="SpamBayes Bug Tracker", ! Enabled=True, ! Visible=True, ! Tag = "SpamBayesCommand.Help.BugTacker") # If we are running from Python sources, enable a few extra items if not hasattr(sys, "frozen"): --- 799,823 ---- if helpPopup is not None: helpPopup = CastTo(helpPopup, "CommandBarPopup") ! self._AddHelpControl(helpPopup, ! "About SpamBayes", ! "about.html", ! "SpamBayesCommand.Help.ShowAbout") ! self._AddHelpControl(helpPopup, ! "Troubleshooting Guide", ! "docs/troubleshooting.html", ! "SpamBayesCommand.Help.ShowTroubleshooting") ! self._AddHelpControl(helpPopup, ! "SpamBayes Website", ! "http://spambayes.sourceforge.net/", ! "SpamBayesCommand.Help.ShowSpamBayes Website") ! self._AddHelpControl(helpPopup, ! "Frequently Asked Questions", ! "http://spambayes.sourceforge.net/faq.html", ! "SpamBayesCommand.Help.ShowFAQ") ! self._AddHelpControl(helpPopup, ! "SpamBayes Bug Tracker", ! "http://sourceforge.net/tracker/?group_id=61702&atid=498103", ! "SpamBayesCommand.Help.BugTacker") ! # If we are running from Python sources, enable a few extra items if not hasattr(sys, "frozen"): *************** *** 860,863 **** --- 831,843 ---- self.have_setup_ui = True + def _AddHelpControl(self, parent, caption, url, tag): + self._AddControl(parent, + constants.msoControlButton, + ButtonEvent, (self.manager.ShowHtml, url), + Caption=caption, + Enabled=True, + Visible=True, + Tag=tag) + def _AddControl(self, parent, # who the control is added to Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** manager.py 10 Aug 2003 07:26:48 -0000 1.70 --- manager.py 10 Aug 2003 07:49:12 -0000 1.71 *************** *** 725,748 **** self.SaveConfig() ! def ShowHtml(self,fileName): """Displays the main SpamBayes documentation in your Web browser""" ! import sys, os ! if hasattr(sys, "frozen"): ! # Same directory as to the executable. ! fname = os.path.join(os.path.dirname(sys.argv[0]), ! fileName) ! else: ! # (ie, main Outlook2000) dir ! fname = os.path.join(os.path.dirname(__file__), ! fileName) ! fname = os.path.abspath(fname) from dialogs import SetWaitCursor ! if os.path.isfile(fname): ! SetWaitCursor(1) ! os.startfile(fname) ! SetWaitCursor(0) ! else: ! print "Cant find ",fileName," - fix messagebox" ! #self.MessageBox("Can't find "+fileName) _mgr = None --- 725,750 ---- self.SaveConfig() ! def ShowHtml(self,url): """Displays the main SpamBayes documentation in your Web browser""" ! import sys, os, urllib ! if urllib.splittype(url)[0] is None: # just a file spec ! if hasattr(sys, "frozen"): ! # Same directory as to the executable. ! fname = os.path.join(os.path.dirname(sys.argv[0]), ! url) ! else: ! # (ie, main Outlook2000) dir ! fname = os.path.join(os.path.dirname(__file__), ! url) ! fname = os.path.abspath(fname) ! if not os.path.isfile(fname): ! self.ReportError("Can't find "+url) ! return ! url = fname ! # else assume it is valid! from dialogs import SetWaitCursor ! SetWaitCursor(1) ! os.startfile(url) ! SetWaitCursor(0) _mgr = None From buics123 at yahoo.com Sun Aug 10 01:57:38 2003 From: buics123 at yahoo.com (Rociel Buico) Date: Sun Aug 10 10:59:40 2003 Subject: [Spambayes-checkins] spambayes technical document Message-ID: <20030810075738.92988.qmail@web41901.mail.yahoo.com> where can i found the spambayes technical document? tia, buics --------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/spambayes-checkins/attachments/20030810/185e649f/attachment.htm From buics123 at yahoo.com Sun Aug 10 02:10:37 2003 From: buics123 at yahoo.com (Rociel Buico) Date: Sun Aug 10 10:59:49 2003 Subject: [Spambayes-checkins] spambayes technical document Message-ID: <20030810081037.58336.qmail@web41904.mail.yahoo.com> hello, where can i get spambayes technical document? tia, --buics --------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/spambayes-checkins/attachments/20030810/9d6d5184/attachment.htm From anadelonbrin at users.sourceforge.net Sun Aug 10 16:23:27 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Aug 10 18:23:32 2003 Subject: [Spambayes-checkins] website faq.txt,1.26,1.27 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv23083 Modified Files: faq.txt Log Message: Update the "enable filtering" question a bit since it has changed somewhat since it was first a FAQ. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** faq.txt 7 Aug 2003 06:40:03 -0000 1.26 --- faq.txt 10 Aug 2003 22:23:24 -0000 1.27 *************** *** 437,444 **** ! Why is the enable filter button grayed out? ! ------------------------------------------- ! You need to have done these things to enable that button: 1. Trained at least 5 ham and 5 spam --- 437,446 ---- ! I get a message that says I need to "enable SpamBayes", or the enable button is greyed out. ! ------------------------------------------------------------------------------------------- ! To activate SpamBayes, you need to tick the "enable filtering" button in ! main SpamBayes dialog. Note that this button will initially be greyed out; ! you need to have done these things to enable the button: 1. Trained at least 5 ham and 5 spam From mhammond at users.sourceforge.net Sun Aug 10 18:24:22 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 20:24:25 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.92,1.93 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv8337 Modified Files: addin.py Log Message: SpamClues shows the percentage as well as the raw score. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** addin.py 10 Aug 2003 07:49:11 -0000 1.92 --- addin.py 11 Aug 2003 00:24:20 -0000 1.93 *************** *** 445,449 **** # way to get this as text only. Next best then is to use HTML, 'cos at # least we know how to exploit it! ! body = ["

    Spam Score: %g


    " % score] push = body.append # Format the clues. --- 445,449 ---- # way to get this as text only. Next best then is to use HTML, 'cos at # least we know how to exploit it! ! body = ["

    Spam Score: %d%% (%g)


    " % (round(score*100), score)] push = body.append # Format the clues. From mhammond at users.sourceforge.net Sun Aug 10 19:02:56 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 10 21:03:00 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/installer installation_notes.rtf, 1.2, 1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/installer In directory sc8-pr-cvs1:/tmp/cvs-serv12987 Modified Files: installation_notes.rtf Log Message: More changes to the wording about Word as email editor. Index: installation_notes.rtf =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/installer/installation_notes.rtf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvs2uSWMb and /tmp/cvscdYdpd differ From mhammond at users.sourceforge.net Mon Aug 11 06:19:10 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 11 08:19:13 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs opt_processors.py, 1.2, 1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv13885 Modified Files: opt_processors.py Log Message: Fix typo in variable name. Index: opt_processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/opt_processors.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** opt_processors.py 10 Aug 2003 07:26:50 -0000 1.2 --- opt_processors.py 11 Aug 2003 12:19:08 -0000 1.3 *************** *** 187,191 **** ids = self.option.get() else: ! ids = [self.optin.get()] from dialogs import FolderSelector if self.option_include_sub: --- 187,191 ---- ids = self.option.get() else: ! ids = [self.option.get()] from dialogs import FolderSelector if self.option_include_sub: From mhammond at users.sourceforge.net Mon Aug 11 06:19:35 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 11 08:19:37 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs FolderSelector.py, 1.21, 1.22 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv14143 Modified Files: FolderSelector.py Log Message: Fix single select dialog. Index: FolderSelector.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** FolderSelector.py 10 Aug 2003 07:26:49 -0000 1.21 --- FolderSelector.py 11 Aug 2003 12:19:32 -0000 1.22 *************** *** 341,346 **** # selected state. try: ! h = win32gui.SendMessage(self.list, commctrl.TVM_GETSELECTEDITEM, ! commctrl.TVGN_CARET, h) except win32gui.error: return --- 341,346 ---- # selected state. try: ! h = win32gui.SendMessage(self.list, commctrl.TVM_GETNEXTITEM, ! commctrl.TVGN_CARET, 0) except win32gui.error: return From montanaro at users.sourceforge.net Mon Aug 11 10:58:40 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Mon Aug 11 12:58:44 2003 Subject: [Spambayes-checkins] website unix.ht,1.4,1.5 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv4884 Modified Files: unix.ht Log Message: use ".hammie.db" consistently as the database name Index: unix.ht =================================================================== RCS file: /cvsroot/spambayes/website/unix.ht,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** unix.ht 7 Aug 2003 01:14:00 -0000 1.4 --- unix.ht 11 Aug 2003 16:58:37 -0000 1.5 *************** *** 27,31 ****
    /usr/local/bin/hammiefilter.py -d $HOME/.hammie.db -n
  • Train it on your existing mail. This is optional, but a good idea. -g is the flag for the known good mail, and -s is for known spam !
    /usr/local/bin/mboxtrain.py -d $HOME/.hammiedb -g $HOME/Mail/inbox -s $HOME/Mail/spam
  • Adding the following recipes to the top of your .procmailrc will get the spam and unsure stuff out of the way. Allowing everything else to be filtered as per your normal procmail recipes.
    --- 27,31 ----
      
    /usr/local/bin/hammiefilter.py -d $HOME/.hammie.db -n
  • Train it on your existing mail. This is optional, but a good idea. -g is the flag for the known good mail, and -s is for known spam !
    /usr/local/bin/mboxtrain.py -d $HOME/.hammie.db -g $HOME/Mail/inbox -s $HOME/Mail/spam
  • Adding the following recipes to the top of your .procmailrc will get the spam and unsure stuff out of the way. Allowing everything else to be filtered as per your normal procmail recipes.
    ***************
    *** 43,47 ****
      
  • For ongoing training, there is a handy little cronjob that will run at 2:21 am every morning, training the database with good mail from Inbox and spam from caughtspam. Just add the following to your crontab !
    21 2 * * * /usr/local/bin/mboxtrain.py -d $HOME/.hammiedb -g $HOME/Mail/Inbox -s $HOME/Mail/spam
  • --- 43,47 ----
  • For ongoing training, there is a handy little cronjob that will run at 2:21 am every morning, training the database with good mail from Inbox and spam from caughtspam. Just add the following to your crontab !
    21 2 * * * /usr/local/bin/mboxtrain.py -d $HOME/.hammie.db -g $HOME/Mail/Inbox -s $HOME/Mail/spam
  • From mhammond at users.sourceforge.net Mon Aug 11 19:31:37 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 11 21:31:40 2003 Subject: [Spambayes-checkins] website faq.txt,1.27,1.28 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv5393 Modified Files: faq.txt Log Message: auto-complete -> auto-archive Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** faq.txt 10 Aug 2003 22:23:24 -0000 1.27 --- faq.txt 12 Aug 2003 01:31:35 -0000 1.28 *************** *** 475,479 **** auto-archive to periodically delete your Spam folder. ! It is recommended that you configure auto-complete to keep at least a few days of Spam around, should the SpamBayes database become corrupt and require you to perform a full re-train. --- 475,479 ---- auto-archive to periodically delete your Spam folder. ! It is recommended that you configure auto-archive to keep at least a few days of Spam around, should the SpamBayes database become corrupt and require you to perform a full re-train. From xenogeist at users.sourceforge.net Mon Aug 11 20:34:45 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 11 22:34:48 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 config.py,1.20,1.21 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv14006/Outlook2000 Modified Files: config.py Log Message: Give Filter.spam_mark_as_read a more accurate tooltip that does not imply changing the new-icon system tray icon. Index: config.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/config.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** config.py 3 Aug 2003 23:38:25 -0000 1.20 --- config.py 12 Aug 2003 02:34:43 -0000 1.21 *************** *** 206,213 **** ("spam_mark_as_read", "Should filtered spam also be marked as 'read'", False, """Determines if spam messages are marked as 'Read' as they are ! filtered. This can be set to 'True' if the new-mail icon bothers you when the only new items are spam. It can be set to 'False' if you use the 'read' state of these messages to determine which ! items you are yet to review.""", BOOLEAN, RESTORE), (FolderIDOption, --- 206,214 ---- ("spam_mark_as_read", "Should filtered spam also be marked as 'read'", False, """Determines if spam messages are marked as 'Read' as they are ! filtered. This can be set to 'True' if the new-mail folder counts bothers you when the only new items are spam. It can be set to 'False' if you use the 'read' state of these messages to determine which ! items you are yet to review. This option does not affect the ! new-mail icon in the system tray.""", BOOLEAN, RESTORE), (FolderIDOption, From xenogeist at users.sourceforge.net Mon Aug 11 20:36:25 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Mon Aug 11 22:36:28 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 config.py,1.21,1.22 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv14271/Outlook2000 Modified Files: config.py Log Message: extra 's' Index: config.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/config.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** config.py 12 Aug 2003 02:34:43 -0000 1.21 --- config.py 12 Aug 2003 02:36:22 -0000 1.22 *************** *** 206,210 **** ("spam_mark_as_read", "Should filtered spam also be marked as 'read'", False, """Determines if spam messages are marked as 'Read' as they are ! filtered. This can be set to 'True' if the new-mail folder counts bothers you when the only new items are spam. It can be set to 'False' if you use the 'read' state of these messages to determine which --- 206,210 ---- ("spam_mark_as_read", "Should filtered spam also be marked as 'read'", False, """Determines if spam messages are marked as 'Read' as they are ! filtered. This can be set to 'True' if the new-mail folder counts bother you when the only new items are spam. It can be set to 'False' if you use the 'read' state of these messages to determine which From anadelonbrin at users.sourceforge.net Mon Aug 11 22:28:08 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 12 00:28:13 2003 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.12,1.13 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv27001/spambayes Modified Files: ProxyUI.py Log Message: Have the review messages page put the unsure messages at the top, because they are the most important to take action on. (As suggested in http://home.dataparty.no/kristian/reviews/bayesian/: "Unfortunately, the unsure section is at the bottom (if any SpamBayes developers are reading this, the unsure section should really be at the top)") Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ProxyUI.py 7 Jul 2003 21:00:02 -0000 1.12 --- ProxyUI.py 12 Aug 2003 04:28:06 -0000 1.13 *************** *** 353,359 **** if len(keys) == 0: keys, date, prior, this, next = self._buildReviewKeys(start) ! keyedMessageInfo = {options["Headers", "header_spam_string"]: [], options["Headers", "header_ham_string"]: [], ! options["Headers", "header_unsure_string"]: []} for key in keys: # Parse the message, get the judgement header and build a message --- 353,360 ---- if len(keys) == 0: keys, date, prior, this, next = self._buildReviewKeys(start) ! keyedMessageInfo = {options["Headers", "header_unsure_string"]: [], options["Headers", "header_ham_string"]: [], ! options["Headers", "header_spam_string"]: [], ! } for key in keys: # Parse the message, get the judgement header and build a message From skip at pobox.com Tue Aug 12 00:34:05 2003 From: skip at pobox.com (Skip Montanaro) Date: Tue Aug 12 00:35:50 2003 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.12,1.13 In-Reply-To: References: Message-ID: <16184.28221.221264.381934@montanaro.dyndns.org> Tony> Have the review messages page put the unsure messages at the top, Tony> because they are the most important to take action on. Is that going to have the desired effect? All you did was change the definition of keyedMessageInfo, which is a dictionary, not a list. Skip From T.A.Meyer at massey.ac.nz Tue Aug 12 17:39:15 2003 From: T.A.Meyer at massey.ac.nz (Meyer, Tony) Date: Tue Aug 12 00:40:01 2003 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.12,1.13 Message-ID: <1ED4ECF91CDED24C8D012BCF2B034F1302BF3A06@its-xchg4.massey.ac.nz> > Is that going to have the desired effect? All you did was > change the definition of keyedMessageInfo, which is a > dictionary, not a list. No, I changed the wrong one. Opps. I'll check in the correct change. =Tony Meyer From anadelonbrin at users.sourceforge.net Mon Aug 11 22:41:48 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 12 00:41:52 2003 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.13,1.14 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv28750/spambayes Modified Files: ProxyUI.py Log Message: As Skip pointed out, that change didn't do anything! Here's the correct change. Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ProxyUI.py 12 Aug 2003 04:28:06 -0000 1.13 --- ProxyUI.py 12 Aug 2003 04:41:46 -0000 1.14 *************** *** 384,393 **** page.table = "" # To make way for the real rows. for header, label in ((options["Headers", ! "header_spam_string"], 'Spam'), (options["Headers", "header_ham_string"], 'Ham'), (options["Headers", ! "header_unsure_string"], ! 'Unsure')): messages = keyedMessageInfo[header] if messages: --- 384,392 ---- page.table = "" # To make way for the real rows. for header, label in ((options["Headers", ! "header_unsure_string"], 'Unsure'), (options["Headers", "header_ham_string"], 'Ham'), (options["Headers", ! "header_spam_string"], 'Spam')): messages = keyedMessageInfo[header] if messages: From anadelonbrin at users.sourceforge.net Mon Aug 11 22:54:20 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 12 00:54:24 2003 Subject: [Spambayes-checkins] website index.ht,1.19,1.20 quotes.ht,1.1,1.2 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv29917 Modified Files: index.ht quotes.ht Log Message: Remove a typo from the index. Add a new quote from the POPFile/SpamBayes review. Index: index.ht =================================================================== RCS file: /cvsroot/spambayes/website/index.ht,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** index.ht 10 Aug 2003 01:15:48 -0000 1.19 --- index.ht 12 Aug 2003 04:54:18 -0000 1.20 *************** *** 152,156 **** The spambayes-announce ! list - a very low volume mailing list announcing new releases &c.
  • --- 152,156 ---- The spambayes-announce ! list - a very low volume mailing list announcing new releases.
  • Index: quotes.ht =================================================================== RCS file: /cvsroot/spambayes/website/quotes.ht,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** quotes.ht 10 Aug 2003 01:15:20 -0000 1.1 --- quotes.ht 12 Aug 2003 04:54:18 -0000 1.2 *************** *** 33,36 **** --- 33,47 ----

    +

    + It's been extraordinarily effective...it catches 99% of my spam + Larry Fresinski of Cornell University's Johnson Graduate School of Management in + two recent + Computerworld issues +

    + +

    + SpamBayes is currently the best solution to the spam problem. In fact, after I started using it I hardly notice there is a spam problem at all + Kristian Eide in a + review comparing POPFile and Spambayes

    What we are saying about us

    From anadelonbrin at users.sourceforge.net Mon Aug 11 22:55:34 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 12 00:55:38 2003 Subject: [Spambayes-checkins] website contact.ht,NONE,1.1 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv30044 Added Files: contact.ht Log Message: First stab at a contact page. Content is just the mailing list info from index.ht and a bit of info about submitting a bug report based on Mark's info in his troubleshooting.html file. --- NEW FILE: contact.ht --- Title: SpamBayes: Contact Information. Author-Email: SpamBayes@python.org Author: SpamBayes

    Mailing lists

    There are currently five mailing lists of interest:

    • The spambayes-announce list - a very low volume mailing list announcing new releases.
    • The spambayes user list. General discussions and user queries go here. (This was also the developer list until late May, 2003).
    • The spambayes developers list spambayes-dev. This list is for discussion of spambayes development. Please don't use this for user questions ("how do I make SB work with Outlook version X"), use the "spambayes" list for that.
    • CVS commit messages go to the list spambayes-checkins.
    • Sourceforge tracker items (bugs, feature requests and patches) go to the list spambayes-bugs.

    Submitting a bug report

    All SpamBayes bugs are maintained in this page at sourceforge. Please have a check of the bugs already reported to see if your bug has already been reported.  If not, open a new bug. Please ensure you attach the log file or traceback to the bug.
    If you are unsure about the bug, or need any assistance, please send a mail.

    Send a mail

    If all else fails, you may want to send someone a mail. Your mail should be sent to the SpamBayes mailing list (spambayes@python.org) Please do not mail any of the contributors directly (see "good karma" below).
    Please ensure this mail contains:
    • which operating system (and the version, if applicable) you are using
    • the version of SpamBayes
    • any log files or traceback.
    The more detailed you are about what has gone wrong, and what you have already tried to do to fix it, the more likely you are to get answered! (And if you can subscribe to this mailing list and help answer other questions, good karma will come your way!)
    From anadelonbrin at users.sourceforge.net Mon Aug 11 23:51:57 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 12 01:52:01 2003 Subject: [Spambayes-checkins] spambayes/spambayes UserInterface.py, 1.13, 1.14 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv4901/spambayes Modified Files: UserInterface.py Log Message: At some point (before the 1.0a4 release) selecting both "header" and "body" stopped working. This fixes that. (as reported by David McNab on the list). Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** UserInterface.py 2 Jul 2003 21:10:41 -0000 1.13 --- UserInterface.py 12 Aug 2003 05:51:55 -0000 1.14 *************** *** 560,564 **** if name[-2:-1] == '-': if parms.has_key(name[:-2]): ! parms[name[:-2]].append(value) else: parms[name[:-2]] = (value,) --- 560,564 ---- if name[-2:-1] == '-': if parms.has_key(name[:-2]): ! parms[name[:-2]] += (value,) else: parms[name[:-2]] = (value,) From anthonybaxter at users.sourceforge.net Tue Aug 12 03:39:35 2003 From: anthonybaxter at users.sourceforge.net (Anthony Baxter) Date: Tue Aug 12 05:39:39 2003 Subject: [Spambayes-checkins] website related.ht,1.9,1.10 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv2053 Modified Files: related.ht Log Message: added a bunch of links, broke into groups. Index: related.ht =================================================================== RCS file: /cvsroot/spambayes/website/related.ht,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** related.ht 1 Jul 2003 00:50:11 -0000 1.9 --- related.ht 12 Aug 2003 09:39:33 -0000 1.10 *************** *** 3,11 **** Author: spambayes !

    Related Projects

    !

    Some projects working in a similar area

    !

    • Gary Robinson has a well-organized Spam Wiki.
    • Gary Arnold's bayespam, a perl qmail filter.
    • As of version 1.3, Mozilla Mail now supports Graham-style Bayesian filtering, see the documentation on the mozilla website. --- 3,15 ---- Author: spambayes !

      Related Websites

      • Gary Robinson has a well-organized Spam Wiki. +
      + +

      OpenSource or free "Bayesian" filters

      +
        +
      • POPFile, a pop3 proxy written in Perl with a Naive Bayes classifier. +
      • Outclass is an Outlook plugin for POPFile
      • Gary Arnold's bayespam, a perl qmail filter.
      • As of version 1.3, Mozilla Mail now supports Graham-style Bayesian filtering, see the documentation on the mozilla website. *************** *** 14,28 ****
      • PASP, the Python Anti-Spam Proxy - a POP3 proxy for filtering email. Also uses Bayesian-ish classification.
      • spamoracle, a Paul Graham based spam filter written in OCaml, designed for use with procmail. !
      • popfile, a pop3 proxy written in Perl with a Naive Bayes classifier. !
      • Spam Bully is a commercial spam filter that claims to use bayesian techniques.
      !

      Projects based on SpamBayes

      !

      These are some projects that are based on SpamBayes. Those that are commercial offer the same success in filtering mail, but in exchange for forking out some money, may be more user-friendly and offer more in the way of support.

      • SpamAtBay is a soon to be available commercial version of the SpamBayes addin for Outlook. SpamAtBay development is headed by Sean True, who wrote the first integration of Outlook and SpamBayes (later this was improved on - basically rewritten using the same idea - by Mark Hammond). SpamAtBay has a more polished layout, documentation and some more consumer oriented features. Contact Sean True for more information.
      • !
      • InBoxer. This is a consumer-oriented release with a simple one-click install process, based on SpamAtBay (in turn, based on SpamBayes). Contact Roger Matys for more information.
      -

      (got more? email anthony@interlink.com.au and I'll add links, or correct descriptions.) --- 18,46 ----

    • PASP, the Python Anti-Spam Proxy - a POP3 proxy for filtering email. Also uses Bayesian-ish classification.
    • spamoracle, a Paul Graham based spam filter written in OCaml, designed for use with procmail. !
    • Spam Assassin now includes "Bayesian" style scoring in it's suite of approaches to spam-hunting. !
    • Annoyance Filter is a C++ package using Graham's algorithm. It's written using Literate Programming techniques. !
    • BSpam is another implementation of Graham in perl. !
    ! ! !

    Projects based on SpamBayes (Commercial or otherwise)

    !

    These are some projects that are based on SpamBayes. Those that are commercial offer the same success in filtering mail, but in exchange for forking out some money, may be more user-friendly and offer more in the way of support.

    • SpamAtBay is a soon to be available commercial version of the SpamBayes addin for Outlook. SpamAtBay development is headed by Sean True, who wrote the first integration of Outlook and SpamBayes (later this was improved on - basically rewritten using the same idea - by Mark Hammond). SpamAtBay has a more polished layout, documentation and some more consumer oriented features. Contact Sean True for more information.
    • !
    • InBoxer. This is a consumer-oriented release with a simple one-click install process, based on SpamAtBay (in turn, based on SpamBayes). Contact Roger Matus for more information.
    • !
    !

    Other Commercial Products using "Bayesian" style filtering

    !
      !
    • Spam Bully is a commercial spam filter that claims to use bayesian techniques. !
    • Death2Spam is a hosted service offering Bayesian-style filtering (written in Java). Richard Jowsey writes: ! "D2S is based on a combination of Paul Graham's and Gary Robinson's theory ! and techniques. It has many similarities to the tokenizer & classifier ! logic used in SpamBayes (I'm not a great Python devotee, but the code is ! quite legible), and POPFile. And, after much experimentation and testing, ! I've considerably elaborated some of the statistical and probability math ! in there."

    (got more? email anthony@interlink.com.au and I'll add links, or correct descriptions.) From anthonybaxter at users.sourceforge.net Tue Aug 12 03:57:35 2003 From: anthonybaxter at users.sourceforge.net (Anthony Baxter) Date: Tue Aug 12 05:57:40 2003 Subject: [Spambayes-checkins] website applications.ht, 1.17, 1.18 download.ht, 1.14, 1.15 index.ht, 1.20, 1.21 windows.ht, 1.24, 1.25 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv4304 Modified Files: applications.ht download.ht index.ht windows.ht Log Message: Moved the three different places with links to Mark's download so that they all point at the windows.html page. That page offers either SF or Mark's site. Also noted public CVS delays with SF. Index: applications.ht =================================================================== RCS file: /cvsroot/spambayes/website/applications.ht,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** applications.ht 9 Aug 2003 04:54:33 -0000 1.17 --- applications.ht 12 Aug 2003 09:57:33 -0000 1.18 *************** *** 27,32 ****

    Availability

    !

    Mark has packaged together an installer for the plugin. ! You can download it from his website. This is currently at version 007.

    Download the alpha4 release.

    --- 27,32 ----

    Availability

    !

    Mark has packaged together an installer for the plugin. ! Go to the Windows page for more. This is currently at version 007.

    Download the alpha4 release.

    Index: download.ht =================================================================== RCS file: /cvsroot/spambayes/website/download.ht,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** download.ht 9 Aug 2003 04:54:33 -0000 1.14 --- download.ht 12 Aug 2003 09:57:33 -0000 1.15 *************** *** 23,28 ****

    Binary Releases

    Outlook Plugin

    !

    Mark has packaged together an installer for the plugin. ! You can download it from his website. This is currently at version 007.

    --- 23,28 ----

    Binary Releases

    Outlook Plugin

    !

    Mark has packaged up a standalone installer of the Outlook plugin. Get it ! from the Windows page on this site. This is currently at version 007.

    *************** *** 33,36 ****

    The code is currently available from sourceforge's CVS server - see here for ! more details.

    --- 33,38 ----

    The code is currently available from sourceforge's CVS server - see here for ! more details. Note that due to capacity problems with Sourceforge, ! the public CVS servers often run up to 24 hours behind the real CVS ! servers. This is something that SF are working on improving.

    Index: index.ht =================================================================== RCS file: /cvsroot/spambayes/website/index.ht,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** index.ht 12 Aug 2003 04:54:18 -0000 1.20 --- index.ht 12 Aug 2003 09:57:33 -0000 1.21 *************** *** 5,9 ****

    News

    !

    Fourth pre-release and Outlook plugin available. See the download page for more.

    You may also like to see what other people have been saying about us in the press and elsewhere.

    --- 5,10 ----

    News

    !

    Outlook plugin release 007 is available. See the Windows page for more. Note that the Outlook plugin is now available from Sourceforge, on this project's Files page.

    !

    Fourth pre-release of spambayes available. See the download page for more.

    You may also like to see what other people have been saying about us in the press and elsewhere.

    Index: windows.ht =================================================================== RCS file: /cvsroot/spambayes/website/windows.ht,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** windows.ht 9 Aug 2003 04:54:33 -0000 1.24 --- windows.ht 12 Aug 2003 09:57:33 -0000 1.25 *************** *** 7,14 ****

    Outlook 2000/Outlook XP

    !

    If you are using Outlook 2000 or Outlook XP (not Outlook Express) ! you should be able to simply download and run the Outlook ! plug-in installer. A separate Python installation is not necessary.

    Note that all users who installed version 006 or earlier of the plugin are --- 7,17 ----

    Outlook 2000/Outlook XP

    !

    If you are using Outlook 2000 or Outlook XP (not Outlook ! Express) you should be able to simply download and run the ! Outlook ! plug-in installer (alternate ! download site). A separate Python installation is not necessary. ! Mark's ! website has more details on this package.

    Note that all users who installed version 006 or earlier of the plugin are From montanaro at users.sourceforge.net Tue Aug 12 13:26:52 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Tue Aug 12 15:26:55 2003 Subject: [Spambayes-checkins] website faq.txt,1.28,1.29 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv3729 Modified Files: faq.txt Log Message: add a couple blank lines after question headers for consistency Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** faq.txt 12 Aug 2003 01:31:35 -0000 1.28 --- faq.txt 12 Aug 2003 19:26:50 -0000 1.29 *************** *** 471,474 **** --- 471,475 ---- How can I configure SpamBayes to delete spam rather than moving it? ------------------------------------------------------------------- + Sorry, but you can't. However, Outlook has an excellent "auto-archive" facility which can be used to the same effect - simply configure *************** *** 481,484 **** --- 482,486 ---- Will "Show Spam Clues" notify a spammer that I opened their message? -------------------------------------------------------------------- + We think not (but we don't have the source code to Outlook to check for sure). In general, there are 2 ways spammers can determine this; From montanaro at users.sourceforge.net Tue Aug 12 13:32:30 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Tue Aug 12 15:32:33 2003 Subject: [Spambayes-checkins] website faq.txt,1.29,1.30 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv4707 Modified Files: faq.txt Log Message: add question about n-way classification with pointers to POPFile and CRM114 Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** faq.txt 12 Aug 2003 19:26:50 -0000 1.29 --- faq.txt 12 Aug 2003 19:32:28 -0000 1.30 *************** *** 815,818 **** --- 815,826 ---- + Can Spambayes be used to perform n-way classification? + ------------------------------------------------------ + + In theory, yes it can, though this has not yet been tried. There are a + couple other tools, `POPFile `_ and `CRM114 + `_. + + Known Problems & Workarounds ============================ From montanaro at users.sourceforge.net Tue Aug 12 14:15:24 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Tue Aug 12 16:15:27 2003 Subject: [Spambayes-checkins] spambayes/contrib nway.py,NONE,1.1 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv11977 Added Files: nway.py Log Message: simple n-way classifier --- NEW FILE: nway.py --- #!/usr/bin/env python """ Demonstration of n-way classification possibilities. Usage: %(prog)s [ -h ] tag=db ... -h - print this message and exit. All args are of the form 'tag=db' where 'tag' is the tag to be given in the X-Spambayes-Classification: header. A single message is read from stdin and a modified message sent to stdout. The message is compared against each database in turn. If its score exceeds the spam threshold when scored against a particular database, an X-Spambayes-Classification header is added and the modified message is written to stdout. If none of the comparisons yields a definite classification, the message is written with an 'X-Spambayes-Classification: unsure' header. Training is left up to the user. In general, you want to train so that a message in a particular category will score as spam when checked against that category's training database. For example, suppose you have the following mbox formatted files: python, music, family, cars. If you wanted to create a training database for each of them you could execute this series of mboxtrain.py commands: mboxtrain.py -d python.db -s python -g music -g family -g cars mboxtrain.py -d music.db -g python -s music -g family -g cars mboxtrain.py -d family.db -g python -g music -s family -g cars mboxtrain.py -d cars.db -g python -g music -g family -s cars You'd then compare messages using a %(prog)s command like this: %(prog)s python=python.db music=music.db family=family.db cars=cars.db """ import getopt import sys import os from spambayes import hammie, mboxutils, Options prog = os.path.basename(sys.argv[0]) def help(): print >> sys.stderr, __doc__ % globals() def main(args): opts, args = getopt.getopt(args, "h") for opt, arg in opts: if opt == '-h': help() return 0 tagdb_list = [] msg = mboxutils.get_message(sys.stdin) try: del msg["X-Spambayes-Classification"] except KeyError: pass for pair in args: tag, db = pair.split('=', 1) h = hammie.open(db, True, 'r') score = h.score(msg) if score >= Options.options.spam_cutoff: msg["X-Spambayes-Classification"] = "%s; %.2f" % (tag, score) break else: msg["X-Spambayes-Classification"] = "unsure" sys.stdout.write(msg.as_string(unixfrom=(msg.get_unixfrom() is not None))) return 0 if __name__ == "__main__": sys.exit(main(sys.argv[1:])) From mhammond at users.sourceforge.net Tue Aug 12 22:00:00 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 13 00:00:20 2003 Subject: [Spambayes-checkins] website Makefile,1.10,1.11 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv16200 Modified Files: Makefile Log Message: Require an explicit 'make version' to update Version.cfg on the website. Index: Makefile =================================================================== RCS file: /cvsroot/spambayes/website/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile 6 Aug 2003 04:11:34 -0000 1.10 --- Makefile 13 Aug 2003 03:59:58 -0000 1.11 *************** *** 1,4 **** # this def'n must occur before the include! ! EXTRA_TARGETS = reply.txt faq.html default.css download/Version.cfg include scripts/make.rules --- 1,14 ---- + # Makefile for the SpamBayes website. + # + # targets supported: + # (default): generate all .html content locally. This includes the + # FAQ (.txt->.ht->.html) and the rest (.ht->.html) + # install: rsync the locally generated content (excluding Version.cfg) + # version: generate download/Version.cfg, and rsync to the website. + # Ensure you have *installed* the latest SpamBayes CVS before + # making this target. + # this def'n must occur before the include! ! EXTRA_TARGETS = reply.txt faq.html default.css include scripts/make.rules *************** *** 29,34 **** --- 39,47 ---- ./scripts/ht2html/ht2html.py -f -s SpamBayesFAQGenerator -r . ./faq.ht + version: download/Version.cfg + download/Version.cfg: $(VERSION_PY) python $(VERSION_PY) -g > download/Version.cfg.tmp + rsync --rsh=$(RSYNC_RSH) -v -r -l -t $(LOCAL_INCLUDE) ./download/Version.cfg.tmp $(LIVE_DEST)/download/Version.cfg mv -f download/Version.cfg.tmp download/Version.cfg From mhammond at users.sourceforge.net Tue Aug 12 22:00:00 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 13 00:00:23 2003 Subject: [Spambayes-checkins] website/scripts rsync-excludes,1.1.1.1,1.2 Message-ID: Update of /cvsroot/spambayes/website/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv16200/scripts Modified Files: rsync-excludes Log Message: Require an explicit 'make version' to update Version.cfg on the website. Index: rsync-excludes =================================================================== RCS file: /cvsroot/spambayes/website/scripts/rsync-excludes,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** rsync-excludes 19 Sep 2002 08:40:55 -0000 1.1.1.1 --- rsync-excludes 13 Aug 2003 03:59:58 -0000 1.2 *************** *** 17,18 **** --- 17,19 ---- Makefile* *.new + Version.cfg From mhammond at users.sourceforge.net Tue Aug 12 22:29:14 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 13 00:29:17 2003 Subject: [Spambayes-checkins] website Makefile,1.11,1.12 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv19442 Modified Files: Makefile Log Message: Clarify my comment on 'installed' Index: Makefile =================================================================== RCS file: /cvsroot/spambayes/website/Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile 13 Aug 2003 03:59:58 -0000 1.11 --- Makefile 13 Aug 2003 04:29:12 -0000 1.12 *************** *** 6,11 **** # install: rsync the locally generated content (excluding Version.cfg) # version: generate download/Version.cfg, and rsync to the website. ! # Ensure you have *installed* the latest SpamBayes CVS before ! # making this target. # this def'n must occur before the include! --- 6,11 ---- # install: rsync the locally generated content (excluding Version.cfg) # version: generate download/Version.cfg, and rsync to the website. ! # Ensure you have *installed* (not just 'cvs up'd) the latest ! # SpamBayes CVS before making this target. # this def'n must occur before the include! From anadelonbrin at users.sourceforge.net Wed Aug 13 00:36:48 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 13 02:36:52 2003 Subject: [Spambayes-checkins] spambayes imapfilter.py,1.50,1.51 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv2907 Modified Files: imapfilter.py Log Message: If you didn't use the -p switch to enter your password interactively, imapfilter would try and get it from the options, but if it wasn't there yet (because you hadn't done the setup yet), it would crash. Fix this. (As reported on the list by Don Chance). Index: imapfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/imapfilter.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** imapfilter.py 6 Aug 2003 23:04:04 -0000 1.50 --- imapfilter.py 13 Aug 2003 06:36:46 -0000 1.51 *************** *** 722,729 **** # it knows that imap:server will eventually be able to have # multiple values, but for the moment, we just use the first one ! server = options["imap", "server"][0] ! username = options["imap", "username"][0] if not promptForPass: ! pwd = options["imap", "password"][0] else: if not launchUI: --- 722,735 ---- # it knows that imap:server will eventually be able to have # multiple values, but for the moment, we just use the first one ! server = options["imap", "server"] ! if len(server) > 0: ! server = server[0] ! username = options["imap", "username"] ! if len(username) > 0: ! username = username[0] if not promptForPass: ! pwd = options["imap", "password"] ! if len(pwd) > 0: ! pwd = pwd[0] else: if not launchUI: From anadelonbrin at users.sourceforge.net Wed Aug 13 01:16:41 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 13 03:16:44 2003 Subject: [Spambayes-checkins] website faq.txt,1.30,1.31 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv8612 Modified Files: faq.txt Log Message: Add a FAQ about how to use a pickle. The bit about why is a bit vague (stolen from memory and storage.py) and could be elaborated on if someone feels like it. Also links between this section and the one about not using dumbdbm. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** faq.txt 12 Aug 2003 19:32:28 -0000 1.30 --- faq.txt 13 Aug 2003 07:16:39 -0000 1.31 *************** *** 823,826 **** --- 823,854 ---- + How do I use a pickle for storage? + ---------------------------------- + + If you don't want to use one of the dbm methods for storage (if you only + have `dumbdbm <#my-database-keeps-getting-corrupted>`_, for example), or + one of the SQL methods, you can use a pickle (of a giant in-memory Python + dict). A pickle will be relatively small, but slower, compared to using + of the the dbm storage methods. + + To use a pickle, set the option "persistent_use_database" to False in your + `configuration file <#how-do-i-configure-pop3proxy-imapfilter-etc-without-a-web-browser>`_, + in the section "Storage" (if you have been using SpamBayes for a while, + check that you don't have an old version of this option elsewhere in your + configuration file, in the pop3proxy or hammiefilter sections). You may + also wish to change the name of the storage file (to end with "pck", for + example), but this is not necessary - to do so, change the + "persistent_storage_file" option (also in the "Storage" section). + + If you specify your database on the command line ("pop3proxy.py -d hammie.db", + for example), then you should use the "-D" switch instead. Note, however, + that it is likely that these switches will change in a future release, and + using the configuration file is a much safer option. + + Note that if you have an existing database, which is not a pickle, you can + not keep using it - this will cause errors. You need to either retrain + from scratch, or use the dbExpImp script to convert it to a pickle. + + Known Problems & Workarounds ============================ *************** *** 840,844 **** SpamBayes' case, always the wrong one. Some versions of dumbdbm have a bug that will cause database corruption, but you shouldn't be using it anyway, ! as it is very inefficient. Instead, either use a pickle or install `pybsddb`_ (bsddb3) and use that instead. If you are not sure which database systems you have available, and/or which one you are currently using, there is a --- 868,873 ---- SpamBayes' case, always the wrong one. Some versions of dumbdbm have a bug that will cause database corruption, but you shouldn't be using it anyway, ! as it is very inefficient. Instead, either ! `use a pickle <#how-do-i-use-a-pickle-for-storage>`_ or install `pybsddb`_ (bsddb3) and use that instead. If you are not sure which database systems you have available, and/or which one you are currently using, there is a From anadelonbrin at users.sourceforge.net Wed Aug 13 02:28:39 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 13 04:28:45 2003 Subject: [Spambayes-checkins] website/scripts/ht2html HTParser.py, 1.1.1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/website/scripts/ht2html In directory sc8-pr-cvs1:/tmp/cvs-serv18362/scripts/ht2html Modified Files: HTParser.py Log Message: Change the email link to a link to the contact page. This will hopefully make it clearer that the spambayes@python.org email is actually to a list, and make it easier to find the mailing list information, rather than having to wade down to the bottom of the index. Note that you might have to do a "make realclean" to get the pages recreated. Index: HTParser.py =================================================================== RCS file: /cvsroot/spambayes/website/scripts/ht2html/HTParser.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** HTParser.py 19 Sep 2002 08:40:55 -0000 1.1.1.1 --- HTParser.py 13 Aug 2003 08:28:37 -0000 1.2 *************** *** 82,89 **** self.__parse(otherlinks) # always have an email address ! self.sidebar.append('Email Us') ! author = self.get('author') # guaranteed ! email = self.get('author-email', author) ! self.sidebar.append(('mailto:' + email, author)) # regular expressions used in massage() --- 82,94 ---- self.__parse(otherlinks) # always have an email address ! # except that lots of people think that this goes to a single ! # support person, rather than a mailing list. So, instead, we ! # link to a whole page of contact information, which includes ! # the 'author' email ! self.sidebar.append('Contact Us') ! self.sidebar.append(('contact.html', 'Contact details')) ! #author = self.get('author') # guaranteed ! #email = self.get('author-email', author) ! #self.sidebar.append(('mailto:' + email, author)) # regular expressions used in massage() From anadelonbrin at users.sourceforge.net Wed Aug 13 02:31:21 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 13 04:31:25 2003 Subject: [Spambayes-checkins] website index.ht,1.21,1.22 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv18736 Modified Files: index.ht Log Message: Since the information is now more prominently on the contact page, free up some space on the front page by removing the mailing list information. Index: index.ht =================================================================== RCS file: /cvsroot/spambayes/website/index.ht,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** index.ht 12 Aug 2003 09:57:33 -0000 1.21 --- index.ht 13 Aug 2003 08:31:19 -0000 1.22 *************** *** 5,9 ****

    News

    !

    Outlook plugin release 007 is available. See the Windows page for more. Note that the Outlook plugin is now available from Sourceforge, on this project's Files page.

    Fourth pre-release of spambayes available. See the download page for more.

    You may also like to see what other people have been saying about us in the press and elsewhere.

    --- 5,9 ----

    News

    !

    Outlook plugin release 007 is available. See the Windows page for more. Note that the Outlook plugin is now available from Sourceforge, on this project's Files page.

    Fourth pre-release of spambayes available. See the download page for more.

    You may also like to see what other people have been saying about us in the press and elsewhere.

    *************** *** 146,177 **** part of the source download.

    - -

    Mailing lists

    -

    There are currently five mailing lists of interest:

    -
      -
    • - The - spambayes-announce - list - a very low volume mailing list announcing new releases. -
    • -
    • - The - spambayes - user list. General discussions and user queries go here. (This was also the developer list until late May, 2003). -
    • -
    • - The spambayes developers list spambayes-dev. This list is for discussion of - spambayes development. Please don't use this for user questions ("how do I - make SB work with Outlook version X"), use the "spambayes" list for that. -
    • -
    • - CVS commit messages go to the list spambayes-checkins. -
    • -
    • - Sourceforge tracker items (bugs, feature requests and patches) - go to the list spambayes-bugs. -
    • -
    --- 146,149 ---- From mhammond at users.sourceforge.net Wed Aug 13 07:40:49 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 13 09:44:37 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dlgcore.py, 1.2, 1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv27505 Modified Files: dlgcore.py Log Message: Fix error handler when setting option, as reported by Tony. Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dlgcore.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dlgcore.py 10 Aug 2003 07:26:49 -0000 1.2 --- dlgcore.py 13 Aug 2003 13:40:47 -0000 1.3 *************** *** 242,247 **** except ValueError, why: mb_flags = win32con.MB_ICONEXCLAMATION | win32con.MB_OK ! win32gui.MessageBox(self.hwnd, str(why), ! self.dialog_def.caption, mb_flags) return False --- 242,246 ---- except ValueError, why: mb_flags = win32con.MB_ICONEXCLAMATION | win32con.MB_OK ! win32gui.MessageBox(self.hwnd, str(why), "SpamBayes", mb_flags) return False From mhammond at users.sourceforge.net Wed Aug 13 07:41:29 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 13 09:44:41 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 filter.py,1.28,1.29 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv27584 Modified Files: filter.py Log Message: Add comments reflecting a real world error report. Index: filter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/filter.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** filter.py 31 Jul 2003 12:30:00 -0000 1.28 --- filter.py 13 Aug 2003 13:41:27 -0000 1.29 *************** *** 86,89 **** --- 86,93 ---- return disposition except: + # Have seen MAPI_E_TABLE_TOO_BIG errors reported here when doing the + # move, but in what is probably a semi-corrupt pst. + # However, this *is* a legitimate error to get if the target folder + # has > 16,383 entries. print "Failed filtering message!", msg import traceback From mhammond at users.sourceforge.net Wed Aug 13 07:42:12 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 13 09:44:53 2003 Subject: [Spambayes-checkins] website windows.ht,1.25,1.26 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv27674 Modified Files: windows.ht Log Message: Remove warnings about Exchange Server, and clarify we need Outlook 2k+ Index: windows.ht =================================================================== RCS file: /cvsroot/spambayes/website/windows.ht,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** windows.ht 12 Aug 2003 09:57:33 -0000 1.25 --- windows.ht 13 Aug 2003 13:42:10 -0000 1.26 *************** *** 18,25 **** recommended to upgrade to the 007 release.

    !

    The Outlook add-in was developed mostly using Outlook 2000 on Windows ! 2000 and Win98SE, in Outlook's Internet Mail Only configuration. Those ! combinations are the best tested, though further testing has been carried ! out with Exchange Server, and all seems to work.

    If you have a problem, the best way to help make progress is to look for --- 18,23 ---- recommended to upgrade to the 007 release.

    !

    The Outlook add-in works with all versions of Windows, and all ! versions of Outlook 2000 and later - see below for more details.

    If you have a problem, the best way to help make progress is to look for *************** *** 35,40 ****

    As far as we know, the latest release of the plugin works with all ! versions of Windows and Outlook (Outlook 2003 should have the latest ! Technical Release installed). If you have a problem, please follow the bug reporting steps above; we will endeavour to keep this page up to date.

    --- 33,38 ----

    As far as we know, the latest release of the plugin works with all ! versions of Windows and Outlook 2000 and later (Outlook 2003 should have ! the latest Technical Release installed). If you have a problem, please follow the bug reporting steps above; we will endeavour to keep this page up to date.

    From montanaro at users.sourceforge.net Wed Aug 13 08:32:28 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 13 10:32:35 2003 Subject: [Spambayes-checkins] website style.css,1.9,1.10 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv3593 Modified Files: style.css Log Message: render tt text at 12 points Index: style.css =================================================================== RCS file: /cvsroot/spambayes/website/style.css,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** style.css 7 Aug 2003 01:52:25 -0000 1.9 --- style.css 13 Aug 2003 14:32:26 -0000 1.10 *************** *** 54,55 **** --- 54,59 ---- font-size: large; } + + TT.literal { + font-size: 12pt; + } From montanaro at users.sourceforge.net Wed Aug 13 08:34:01 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 13 10:34:05 2003 Subject: [Spambayes-checkins] website faq.txt,1.31,1.32 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv3822 Modified Files: faq.txt Log Message: Add Ed Rubinsky's q&a about manual Eudora configuration file editing Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** faq.txt 13 Aug 2003 07:16:39 -0000 1.31 --- faq.txt 13 Aug 2003 14:33:59 -0000 1.32 *************** *** 72,76 **** details. ! * Dontate money to the Python Software Foundations. For more information, including why you would want to donate to the PSF, please see our `donations page`_. --- 72,76 ---- details. ! * Donate money to the Python Software Foundations. For more information, including why you would want to donate to the PSF, please see our `donations page`_. *************** *** 93,97 **** 2. The `Spambayes developers list`_ provides a forum for people ! maintaining and improving the pacakge. 3. The `Spambayes announcements list`_ is a low-volume list where --- 93,97 ---- 2. The `Spambayes developers list`_ provides a forum for people ! maintaining and improving the package. 3. The `Spambayes announcements list`_ is a low-volume list where *************** *** 343,346 **** --- 343,415 ---- .. _POP3: http://spambayes.sf.net/applications.html#pop3 .. _IMAP: http://spambayes.sf.net/applications.html#imap + + + How do I configure Eudora for use with Spambayes? + ------------------------------------------------- + + Note: The following instructions have been verified using Eudora 5.1 + under Windows. If anyone is using Eudora under Max OS please let us + know if the configuration is the same as Windows. + + Eudora does not allow configuring the server port through the + normal options dialogue. However a large number of options are exposed + in an initialization file (eudora.ini) read at startup. The contents + of the initialization file are documented by clicking on Help->Topics + and searching on EUDORA.INI (you may want to print this help page for + future reference.) Depending on how you installed Eudora, eudora.ini + is located either in the Eudora install directory or the user's + setting directory, e.g.:: + + C:\Documents and Settings\userid\ApplicationData\Qualcomm\Eudora\eudora.ini + + 1. Locate ``eudora.ini``. + + 2. Make two copies - ``eudoraok.ini`` for backup and ``eudorame.ini`` to + modify. + + 3. Configure pop3proxy for each of Eudora's personalities' POP3 servers, + specifying a separate port for each. For example 1110, 1120, 1130 and + 1140 for four personalities. Do the same for smtpproxy - for example + 1115, 1125, 1135 and 1145 corresponding to the four POP3 servers. + + 4. Close Eudora. + + 5. Open ``eudorame.ini`` with a text editor - Notepad for example. **Do not + use a word processor to edit the initialization file**. + + 6. Find the section starting with ``[Settings]``. This contains settings for + the dominant personality. + + 7. Find the line beginning ``POPAccount``. The last part of the account name + starting with ``@`` is the server. Change it to ``@localhost``. + + 8. Find the lines beginning ``SMTPServer`` and ``POPServer``. They will have + the server names defined for your dominant personality. + + 9. Change both server names to ``localhost``. + + 10, Add the following two lines. Use whatever ports you assigned to + pop3proxy and smtpproxy for the dominant personality:: + + POPPort=1110 + SMTPPort=1115 + + 11. Setting for other personalities are kept in sections beginning with + ``[Persona-personality_name]``. For each personality make the same + changes as you made for the dominant personality, substituting the + proper port numbers. + + 12. Copy ``eudorame.ini`` to ``eudora.ini`` and re-start Eudora. + + 13. In the password dialog for each personality you should see ``localhost`` + where you used to see the actual server name. This may take some getting + used to at first. Since every personality will now have a server named + localhost you will have to know what order Eudora prompts for the user + id's and passwords. + + 14. If there are any problems, close Eudora, copy eudoraok.ini to eudora.ini + and restart Eudora. This will restore Eudora's original configuration + until the problem can be resolved. + From montanaro at users.sourceforge.net Wed Aug 13 08:34:30 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 13 10:34:33 2003 Subject: [Spambayes-checkins] website faq.txt,1.32,1.33 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv3894 Modified Files: faq.txt Log Message: typo Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** faq.txt 13 Aug 2003 14:33:59 -0000 1.32 --- faq.txt 13 Aug 2003 14:34:28 -0000 1.33 *************** *** 389,393 **** 9. Change both server names to ``localhost``. ! 10, Add the following two lines. Use whatever ports you assigned to pop3proxy and smtpproxy for the dominant personality:: --- 389,393 ---- 9. Change both server names to ``localhost``. ! 10. Add the following two lines. Use whatever ports you assigned to pop3proxy and smtpproxy for the dominant personality:: From montanaro at users.sourceforge.net Wed Aug 13 08:36:02 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 13 10:36:05 2003 Subject: [Spambayes-checkins] website faq.txt,1.33,1.34 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv4176 Modified Files: faq.txt Log Message: fix missing indentation Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** faq.txt 13 Aug 2003 14:34:28 -0000 1.33 --- faq.txt 13 Aug 2003 14:35:59 -0000 1.34 *************** *** 392,397 **** pop3proxy and smtpproxy for the dominant personality:: ! POPPort=1110 ! SMTPPort=1115 11. Setting for other personalities are kept in sections beginning with --- 392,397 ---- pop3proxy and smtpproxy for the dominant personality:: ! POPPort=1110 ! SMTPPort=1115 11. Setting for other personalities are kept in sections beginning with From montanaro at users.sourceforge.net Wed Aug 13 08:39:37 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 13 10:39:43 2003 Subject: [Spambayes-checkins] spambayes/contrib nway.py,1.1,1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1:/tmp/cvs-serv4797 Modified Files: nway.py Log Message: When running mboxtrain.py over the same files multiple times -f is required to force it to consider all messages each time. Index: nway.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/contrib/nway.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** nway.py 12 Aug 2003 20:15:22 -0000 1.1 --- nway.py 13 Aug 2003 14:39:35 -0000 1.2 *************** *** 24,31 **** series of mboxtrain.py commands: ! mboxtrain.py -d python.db -s python -g music -g family -g cars ! mboxtrain.py -d music.db -g python -s music -g family -g cars ! mboxtrain.py -d family.db -g python -g music -s family -g cars ! mboxtrain.py -d cars.db -g python -g music -g family -s cars You'd then compare messages using a %(prog)s command like this: --- 24,31 ---- series of mboxtrain.py commands: ! mboxtrain.py -f -d python.db -s python -g music -g family -g cars ! mboxtrain.py -f -d music.db -g python -s music -g family -g cars ! mboxtrain.py -f -d family.db -g python -g music -s family -g cars ! mboxtrain.py -f -d cars.db -g python -g music -g family -s cars You'd then compare messages using a %(prog)s command like this: From montanaro at users.sourceforge.net Wed Aug 13 08:52:29 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 13 10:52:34 2003 Subject: [Spambayes-checkins] website faq.txt,1.34,1.35 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv6750 Modified Files: faq.txt Log Message: mention nway.py Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** faq.txt 13 Aug 2003 14:35:59 -0000 1.34 --- faq.txt 13 Aug 2003 14:52:27 -0000 1.35 *************** *** 889,893 **** In theory, yes it can, though this has not yet been tried. There are a couple other tools, `POPFile `_ and `CRM114 ! `_. --- 889,895 ---- In theory, yes it can, though this has not yet been tried. There are a couple other tools, `POPFile `_ and `CRM114 ! `_. A demonstration script which performs ! n-way classification was also recently added to the ``contrib`` directory of ! the Spambayes CVS repository. From montanaro at users.sourceforge.net Wed Aug 13 09:00:57 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Aug 13 11:01:02 2003 Subject: [Spambayes-checkins] website unix.ht,1.5,1.6 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv8179 Modified Files: unix.ht Log Message: be consistent in use of -d flag for hammiefilter Index: unix.ht =================================================================== RCS file: /cvsroot/spambayes/website/unix.ht,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** unix.ht 11 Aug 2003 16:58:37 -0000 1.5 --- unix.ht 13 Aug 2003 15:00:54 -0000 1.6 *************** *** 31,35 ****
            :0fw:hamlock
    !       | /usr/local/bin/hammiefilter.py
      
            :0
    --- 31,35 ----
      
            :0fw:hamlock
    !       | /usr/local/bin/hammiefilter.py -d $HOME/.hammie.db
      
            :0
    
    
    
    From xenogeist at users.sourceforge.net  Wed Aug 13 13:31:12 2003
    From: xenogeist at users.sourceforge.net (Adam Walker)
    Date: Wed Aug 13 15:31:26 2003
    Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources
    	rcparser.py, 1.2, 1.3
    Message-ID: 
    
    Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources
    In directory sc8-pr-cvs1:/tmp/cvs-serv28122/Outlook2000/dialogs/resources
    
    Modified Files:
    	rcparser.py 
    Log Message:
    Handle case where dialogs are not grouped together.
    
    Index: rcparser.py
    ===================================================================
    RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/rcparser.py,v
    retrieving revision 1.2
    retrieving revision 1.3
    diff -C2 -d -r1.2 -r1.3
    *** rcparser.py	10 Aug 2003 07:26:50 -0000	1.2
    --- rcparser.py	13 Aug 2003 19:31:10 -0000	1.3
    ***************
    *** 120,126 ****
              f = open(rcFileName)
              self.open(f)
    !         while self.token!=None and self.token[0:4]!="IDD_":
    !             self.getToken()
    !         while self.token!=None and self.token[0:4]=="IDD_":
                  self.parse()
                  self.getToken()
    --- 120,125 ----
              f = open(rcFileName)
              self.open(f)
    !         self.getToken()
    !         while self.token!=None:
                  self.parse()
                  self.getToken()
    ***************
    *** 131,138 ****
      
          def parse(self):
              if self.token == None:
                  more == None
    !         elif "LANGUAGE" == self.token:
    !             more = self.lang()
              else:
                  possibleDlgName = self.token
    --- 130,146 ----
      
          def parse(self):
    +         deep = 0
              if self.token == None:
                  more == None
    !         elif "BEGIN" == self.token:
    !             deep = 1
    !             while deep!=0:
    !                 self.getToken()
    !                 if "BEGIN" == self.token:
    !                     deep += 1
    !                 elif "END" == self.token:
    !                     deep -= 1
    !         elif "IDD_" != self.token[:4]:
    !             self.getToken()
              else:
                  possibleDlgName = self.token
    
    
    
    From anadelonbrin at users.sourceforge.net  Wed Aug 13 16:48:40 2003
    From: anadelonbrin at users.sourceforge.net (Tony Meyer)
    Date: Wed Aug 13 18:48:50 2003
    Subject: [Spambayes-checkins] spambayes/spambayes hammiebulk.py,1.8,1.9
    Message-ID: 
    
    Update of /cvsroot/spambayes/spambayes/spambayes
    In directory sc8-pr-cvs1:/tmp/cvs-serv32170/spambayes
    
    Modified Files:
    	hammiebulk.py 
    Log Message:
    Update option retrieval, since some of the backwards compat code isn't
    working as it should.
    
    This should fix both:
    [ 787296 ] Local installation problem: hammiefilter_persistent_storage
    and
    [ 788002 ] hammiebulk.py uses wrong option name
    
    Index: hammiebulk.py
    ===================================================================
    RCS file: /cvsroot/spambayes/spambayes/spambayes/hammiebulk.py,v
    retrieving revision 1.8
    retrieving revision 1.9
    diff -C2 -d -r1.8 -r1.9
    *** hammiebulk.py	9 Jul 2003 00:53:38 -0000	1.8
    --- hammiebulk.py	13 Aug 2003 22:48:38 -0000	1.9
    ***************
    *** 60,64 ****
      
      # Default database name
    ! DEFAULTDB = os.path.expanduser(options.hammiefilter_persistent_storage_file)
      # This is a bit of a hack to counter the default for
      # persistent_storage_file changing from ~/.hammiedb to hammie.db
    --- 60,64 ----
      
      # Default database name
    ! DEFAULTDB = os.path.expanduser(options["Storage", "persistent_storage_file"])
      # This is a bit of a hack to counter the default for
      # persistent_storage_file changing from ~/.hammiedb to hammie.db
    
    
    
    From anadelonbrin at users.sourceforge.net  Wed Aug 13 16:49:43 2003
    From: anadelonbrin at users.sourceforge.net (Tony Meyer)
    Date: Wed Aug 13 18:49:52 2003
    Subject: [Spambayes-checkins] spambayes hammiefilter.py,1.18,1.19
    Message-ID: 
    
    Update of /cvsroot/spambayes/spambayes
    In directory sc8-pr-cvs1:/tmp/cvs-serv32376
    
    Modified Files:
    	hammiefilter.py 
    Log Message:
    Update option retrieval, since some of the backwards compat code isn't
    working as it should.
    
    Index: hammiefilter.py
    ===================================================================
    RCS file: /cvsroot/spambayes/spambayes/hammiefilter.py,v
    retrieving revision 1.18
    retrieving revision 1.19
    diff -C2 -d -r1.18 -r1.19
    *** hammiefilter.py	5 Jun 2003 15:06:24 -0000	1.18
    --- hammiefilter.py	13 Aug 2003 22:49:41 -0000	1.19
    ***************
    *** 100,112 ****
              #   * had hammie.db as their value for persistent_storage_file, and
              #   * their config file was loaded by Options.py.
    !         if options["hammiefilter", "persistent_storage_file"] == \
                 options.default("Storage", "persistent_storage_file"):
    !             options["hammiefilter", "persistent_storage_file"] = \
                                          "~/.hammiedb"
              options.merge_files(['/etc/hammierc',
                                  os.path.expanduser('~/.hammierc')])
    !         self.dbname = options["hammiefilter", "persistent_storage_file"]
              self.dbname = os.path.expanduser(self.dbname)
    !         self.usedb = options["hammiefilter", "persistent_use_database"]
      
          def newdb(self):
    --- 100,112 ----
              #   * had hammie.db as their value for persistent_storage_file, and
              #   * their config file was loaded by Options.py.
    !         if options["Storage", "persistent_storage_file"] == \
                 options.default("Storage", "persistent_storage_file"):
    !             options["Storage", "persistent_storage_file"] = \
                                          "~/.hammiedb"
              options.merge_files(['/etc/hammierc',
                                  os.path.expanduser('~/.hammierc')])
    !         self.dbname = options["Storage", "persistent_storage_file"]
              self.dbname = os.path.expanduser(self.dbname)
    !         self.usedb = options["Storage", "persistent_use_database"]
      
          def newdb(self):
    
    
    
    From anadelonbrin at users.sourceforge.net  Wed Aug 13 16:59:54 2003
    From: anadelonbrin at users.sourceforge.net (Tony Meyer)
    Date: Wed Aug 13 19:00:18 2003
    Subject: [Spambayes-checkins] spambayes mboxtrain.py,1.11,1.12
    Message-ID: 
    
    Update of /cvsroot/spambayes/spambayes
    In directory sc8-pr-cvs1:/tmp/cvs-serv1580
    
    Modified Files:
    	mboxtrain.py 
    Log Message:
    Implement patches from:
    [ 788001 ] mboxtrain.py maildir bugfix and feature
    
    The main change is the addition of an "-r" switch that will remove the
    training data after it is used.  There are also a couple of other minor
    improvements.
    
    Index: mboxtrain.py
    ===================================================================
    RCS file: /cvsroot/spambayes/spambayes/mboxtrain.py,v
    retrieving revision 1.11
    retrieving revision 1.12
    diff -C2 -d -r1.11 -r1.12
    *** mboxtrain.py	9 Jul 2003 06:35:49 -0000	1.11
    --- mboxtrain.py	13 Aug 2003 22:59:52 -0000	1.12
    ***************
    *** 35,39 ****
              
          -n  train mail residing in "new" directory, in addition to "cur" directory,
    !         which is always trained
      """
      
    --- 35,41 ----
              
          -n  train mail residing in "new" directory, in addition to "cur" directory,
    !         which is always trained (Maildir only)
    ! 
    !     -r  remove mail which was trained on (Maildir only)
      """
      
    ***************
    *** 46,49 ****
    --- 48,52 ----
      import sys, os, getopt
      from spambayes import hammie, mboxutils
    + from spambayes.Options import options
      
      program = sys.argv[0]
    ***************
    *** 63,69 ****
      
          if is_spam:
    !         spamtxt = "spam"
          else:
    !         spamtxt = "ham"
          oldtxt = msg.get(TRAINED_HDR)
          if force:
    --- 66,72 ----
      
          if is_spam:
    !         spamtxt = options["Headers", "header_spam_string"]
          else:
    !         spamtxt = options["Headers", "header_ham_string"]
          oldtxt = msg.get(TRAINED_HDR)
          if force:
    ***************
    *** 83,90 ****
          return True
      
    ! def maildir_train(h, path, is_spam, force):
          """Train bayes with all messages from a maildir."""
      
    !     if loud: print "  Reading as Maildir"
      
          import time
    --- 86,93 ----
          return True
      
    ! def maildir_train(h, path, is_spam, force, removetrained):
          """Train bayes with all messages from a maildir."""
      
    !     if loud: print "  Reading %s as Maildir" % (path,)
      
          import time
    ***************
    *** 97,105 ****
      
          for fn in os.listdir(path):
    -         counter += 1
              cfn = os.path.join(path, fn)
              tfn = os.path.normpath(os.path.join(path, "..", "tmp",
                                 "%d.%d_%d.%s" % (time.time(), pid,
                                                  counter, host)))
              if loud:
                  sys.stdout.write("  %s        \r" % fn)
    --- 100,110 ----
      
          for fn in os.listdir(path):
              cfn = os.path.join(path, fn)
              tfn = os.path.normpath(os.path.join(path, "..", "tmp",
                                 "%d.%d_%d.%s" % (time.time(), pid,
                                                  counter, host)))
    +         if (os.path.isdir(cfn)):
    +             continue
    +         counter += 1
              if loud:
                  sys.stdout.write("  %s        \r" % fn)
    ***************
    *** 117,120 ****
    --- 122,127 ----
              # people actually use Maildirs?
              os.rename(tfn, cfn)
    +         if (removetrained):
    +             os.unlink(cfn)
      
          if loud:
    ***************
    *** 208,212 ****
                     (trained, counter))
      
    ! def train(h, path, is_spam, force, trainnew):
          if not os.path.exists(path):
              raise ValueError("Nonexistent path: %s" % path)
    --- 215,219 ----
                     (trained, counter))
      
    ! def train(h, path, is_spam, force, trainnew, removetrained):
          if not os.path.exists(path):
              raise ValueError("Nonexistent path: %s" % path)
    ***************
    *** 214,220 ****
              mbox_train(h, path, is_spam, force)
          elif os.path.isdir(os.path.join(path, "cur")):
    !         maildir_train(h, os.path.join(path, "cur"), is_spam, force)
              if trainnew:
    !             maildir_train(h, os.path.join(path, "new"), is_spam, force)
          elif os.path.isdir(path):
              mhdir_train(h, path, is_spam, force)
    --- 221,227 ----
              mbox_train(h, path, is_spam, force)
          elif os.path.isdir(os.path.join(path, "cur")):
    !         maildir_train(h, os.path.join(path, "cur"), is_spam, force, removetrained)
              if trainnew:
    !             maildir_train(h, os.path.join(path, "new"), is_spam, force, removetrained)
          elif os.path.isdir(path):
              mhdir_train(h, path, is_spam, force)
    ***************
    *** 237,241 ****
      
          try:
    !         opts, args = getopt.getopt(sys.argv[1:], 'hfqnd:D:g:s:')
          except getopt.error, msg:
              usage(2, msg)
    --- 244,248 ----
      
          try:
    !         opts, args = getopt.getopt(sys.argv[1:], 'hfqnrd:D:g:s:')
          except getopt.error, msg:
              usage(2, msg)
    ***************
    *** 248,251 ****
    --- 255,259 ----
          force = False
          trainnew = False
    +     removetrained = False
          good = []
          spam = []
    ***************
    *** 263,266 ****
    --- 271,276 ----
              elif opt == '-s':
                  spam.append(arg)
    +         elif opt == "-r":
    +             removetrained = True
              elif opt == "-d":
                  usedb = True
    ***************
    *** 279,288 ****
          for g in good:
              if loud: print "Training ham (%s):" % g
    !         train(h, g, False, force, trainnew)
              save = True
      
          for s in spam:
              if loud: print "Training spam (%s):" % s
    !         train(h, s, True, force, trainnew)
              save = True
      
    --- 289,298 ----
          for g in good:
              if loud: print "Training ham (%s):" % g
    !         train(h, g, False, force, trainnew, removetrained)
              save = True
      
          for s in spam:
              if loud: print "Training spam (%s):" % s
    !         train(h, s, True, force, trainnew, removetrained)
              save = True
      
    
    
    
    From anadelonbrin at users.sourceforge.net  Wed Aug 13 17:10:51 2003
    From: anadelonbrin at users.sourceforge.net (Tony Meyer)
    Date: Wed Aug 13 19:11:06 2003
    Subject: [Spambayes-checkins] spambayes smtpproxy.py,1.7,1.8
    Message-ID: 
    
    Update of /cvsroot/spambayes/spambayes
    In directory sc8-pr-cvs1:/tmp/cvs-serv3367
    
    Modified Files:
    	smtpproxy.py 
    Log Message:
    Although the RFC requires that MAIL FROM addresses have < and > around
    them, apparently some MUA doesn't do this, so allow for this.
    
    Fixes:
     [ spambayes-Bugs-788008 ] smtpproxy.py assumes toogood format for addresses
    
    Index: smtpproxy.py
    ===================================================================
    RCS file: /cvsroot/spambayes/spambayes/smtpproxy.py,v
    retrieving revision 1.7
    retrieving revision 1.8
    diff -C2 -d -r1.7 -r1.8
    *** smtpproxy.py	28 Apr 2003 00:36:03 -0000	1.7
    --- smtpproxy.py	13 Aug 2003 23:10:49 -0000	1.8
    ***************
    *** 292,298 ****
              getting FROM: addresses.
              """
    !         start = string.index(address, '<') + 1
    !         end = string.index(address, '>')
    !         return address[start:end]
      
          def splitTo(self, address):
    --- 292,301 ----
              getting FROM: addresses.
              """
    !         if '<' in address:
    !             start = string.index(address, '<') + 1
    !             end = string.index(address, '>')
    !             return address[start:end]
    !         else:
    !             return address
      
          def splitTo(self, address):
    
    
    
    From xenogeist at users.sourceforge.net  Thu Aug 14 15:12:00 2003
    From: xenogeist at users.sourceforge.net (Adam Walker)
    Date: Thu Aug 14 17:12:04 2003
    Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources
    	rc2py.py, 1.2, 1.3 rcparser.py, 1.3, 1.4
    Message-ID: 
    
    Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources
    In directory sc8-pr-cvs1:/tmp/cvs-serv9932/Outlook2000/dialogs/resources
    
    Modified Files:
    	rc2py.py rcparser.py 
    Log Message:
    Parse .h file. Allow parsing of picture boxes (static controls with a image), these controls require that the ids of the bitmaps match the .h file. Parse BITMAP clauses in the .rc and store the filenames in a dict member of RCParser called 'bitmaps'
    
    Index: rc2py.py
    ===================================================================
    RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/rc2py.py,v
    retrieving revision 1.2
    retrieving revision 1.3
    diff -C2 -d -r1.2 -r1.3
    *** rc2py.py	10 Aug 2003 07:26:50 -0000	1.2
    --- rc2py.py	14 Aug 2003 21:11:57 -0000	1.3
    ***************
    *** 23,26 ****
    --- 23,27 ----
          out.write("\tids = "+repr(rcp.ids)+"\n")
          out.write("\tnames = "+repr(rcp.names)+"\n")
    +     out.write("\tbitmaps = "+repr(rcp.bitmaps)+"\n")
          out.write("def ParseDialogs(s):\n")
          out.write("\treturn FakeParser()\n")
    
    Index: rcparser.py
    ===================================================================
    RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/rcparser.py,v
    retrieving revision 1.3
    retrieving revision 1.4
    diff -C2 -d -r1.3 -r1.4
    *** rcparser.py	13 Aug 2003 19:31:10 -0000	1.3
    --- rcparser.py	14 Aug 2003 21:11:57 -0000	1.4
    ***************
    *** 8,11 ****
    --- 8,12 ----
      import sys, os, shlex
      import win32con
    + #import win32gui
      import commctrl
      
    ***************
    *** 92,97 ****
      
      class RCParser:
    -     ids = {"IDOK":1, "IDCANCEL":2, "IDC_STATIC": -1}
    -     names = {1:"IDOK", 2:"IDCANCEL", -1:"IDC_STATIC"}
          next_id = 1001
          dialogs = {}
    --- 93,96 ----
    ***************
    *** 100,103 ****
    --- 99,107 ----
          token = ""
      
    +     def __init__(self):    
    +         self.ids = {"IDOK":1, "IDCANCEL":2, "IDC_STATIC": -1}
    +         self.names = {1:"IDOK", 2:"IDCANCEL", -1:"IDC_STATIC"}
    +         self.bitmaps = {}
    + 
          def debug(self, *args):
              if self.debugEnabled:
    ***************
    *** 118,121 ****
    --- 122,132 ----
              The "names" member contains the dictionary of name->id
              """
    +         hFileName = rcFileName[:-2]+"h"
    +         try:
    +             h = open(hFileName, "rU")
    +             self.parseH(h)
    +             h.close()
    +         except:
    +             print "No .h file. ignoring."
              f = open(rcFileName)
              self.open(f)
    ***************
    *** 129,132 ****
    --- 140,160 ----
              self.lex.commenters = "//#"
      
    +     def parseH(self, file):
    +         lex = shlex.shlex(file)
    +         lex.commenters = "//"
    +         token = " "
    +         while token is not None:
    +             token = lex.get_token()
    +             if token == "" or token is None:
    +                 token = None
    +             else:
    +                 if token=='define':
    +                     n = lex.get_token()
    +                     i = int(lex.get_token())
    +                     self.ids[n] = i
    +                     self.names[i] = n
    +                     if self.next_id<=i:
    +                         self.next_id = i+1
    + 
          def parse(self):
              deep = 0
    ***************
    *** 141,151 ****
                      elif "END" == self.token:
                          deep -= 1
    !         elif "IDD_" != self.token[:4]:
    !             self.getToken()
    !         else:
                  possibleDlgName = self.token
                  self.getToken()
                  if "DIALOG" == self.token or "DIALOGEX" == self.token:
                      self.dialog(possibleDlgName)
      
          def addId(self, id_name):
    --- 169,187 ----
                      elif "END" == self.token:
                          deep -= 1
    !         elif "IDD_" == self.token[:4]:
                  possibleDlgName = self.token
    +             #print "possible dialog:", possibleDlgName
                  self.getToken()
                  if "DIALOG" == self.token or "DIALOGEX" == self.token:
                      self.dialog(possibleDlgName)
    +         elif "IDB_" == self.token[:4]:
    +             possibleBitmap = self.token
    +             self.getToken()
    +             if "BITMAP" == self.token:
    +                 self.getToken()
    +                 bmf = self.token[1:-1] # quotes
    +                 self.bitmaps[possibleBitmap] = bmf
    +                 print "BITMAP", possibleBitmap, bmf
    +                 #print win32gui.LoadImage(0, bmf, win32con.IMAGE_BITMAP,0,0,win32con.LR_DEFAULTCOLOR|win32con.LR_LOADFROMFILE)
      
          def addId(self, id_name):
    ***************
    *** 263,266 ****
    --- 299,306 ----
                  if self.token[0:1]=='"':
                      control.label = self.token[1:-1]
    +                 self.getToken() # ,
    +                 self.getToken()
    +             elif self.token.isdigit():
    +                 control.label = self.token
                      self.getToken() # ,
                      self.getToken()
    
    
    
    From xenogeist at users.sourceforge.net  Thu Aug 14 18:37:22 2003
    From: xenogeist at users.sourceforge.net (Adam Walker)
    Date: Thu Aug 14 20:37:26 2003
    Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs processors.py,
    	1.2, 1.3
    Message-ID: 
    
    Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs
    In directory sc8-pr-cvs1:/tmp/cvs-serv7658/Outlook2000/dialogs
    
    Modified Files:
    	processors.py 
    Log Message:
    Added ImageProcessor class that loads images for picture boxes.
    
    Index: processors.py
    ===================================================================
    RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/processors.py,v
    retrieving revision 1.2
    retrieving revision 1.3
    diff -C2 -d -r1.2 -r1.3
    *** processors.py	10 Aug 2003 07:26:50 -0000	1.2
    --- processors.py	15 Aug 2003 00:37:20 -0000	1.3
    ***************
    *** 37,40 ****
    --- 37,58 ----
              pass
      
    + class ImageProcessor(ControlProcessor):
    +     def Init(self):
    +         filename = ""
    +         rcp = self.window.manager.dialog_parser;
    +         text = win32gui.GetWindowText(self.GetControl())
    +         name = rcp.names[int(text)]
    +         filename = rcp.bitmaps[name]
    +         import os
    +         if not os.path.isabs(filename):
    +             filename = os.path.join( os.path.dirname( __file__ ), "resources", filename)
    +         handle = win32gui.LoadImage(0, filename, win32con.IMAGE_BITMAP,0,0,
    +                                     win32con.LR_COLOR|win32con.LR_LOADFROMFILE|win32con.LR_SHARED)
    +         win32gui.SendMessage(self.GetControl(), win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, handle)
    +         
    + 
    +     def GetPopupHelpText(self, cid):
    +         return None
    +     
      class ButtonProcessor(ControlProcessor):
          def OnCommand(self, wparam, lparam):
    
    
    
    From anadelonbrin at users.sourceforge.net  Sat Aug 16 01:24:35 2003
    From: anadelonbrin at users.sourceforge.net (Tony Meyer)
    Date: Sat Aug 16 03:24:37 2003
    Subject: [Spambayes-checkins] website quotes.ht,1.2,1.3
    Message-ID: 
    
    Update of /cvsroot/spambayes/website
    In directory sc8-pr-cvs1:/tmp/cvs-serv19127
    
    Modified Files:
    	quotes.ht 
    Log Message:
    Add a quote from the WatchGuard LiveSecurity column that Neale forwarded to
    spambayes-dev.
    
    Index: quotes.ht
    ===================================================================
    RCS file: /cvsroot/spambayes/website/quotes.ht,v
    retrieving revision 1.2
    retrieving revision 1.3
    diff -C2 -d -r1.2 -r1.3
    *** quotes.ht	12 Aug 2003 04:54:18 -0000	1.2
    --- quotes.ht	16 Aug 2003 07:24:32 -0000	1.3
    ***************
    *** 43,47 ****
      SpamBayes is currently the best solution to the spam problem. In fact, after I started using it I hardly notice there is a spam problem at all
      Kristian Eide in a 
    ! review comparing POPFile and Spambayes

    What we are saying about us

    --- 43,53 ---- SpamBayes is currently the best solution to the spam problem. In fact, after I started using it I hardly notice there is a spam problem at all Kristian Eide in a ! review comparing POPFile and Spambayes !

    ! !

    ! Now you know a simple way to regain absolute control of your Inbox/i> ! Corey Nachreiner in "Keep Spam at Bay with SpamBayes", a WatchGuard LiveSecurity column !

    What we are saying about us

    From anadelonbrin at users.sourceforge.net Sat Aug 16 01:46:43 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sat Aug 16 03:46:47 2003 Subject: [Spambayes-checkins] spambayes/utilities which_database.py,1.1,1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/utilities In directory sc8-pr-cvs1:/tmp/cvs-serv21247/utilities Modified Files: which_database.py Log Message: Make the script a little smarter about checking if bsddb[3] is available. Index: which_database.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/utilities/which_database.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** which_database.py 29 Jul 2003 23:25:31 -0000 1.1 --- which_database.py 16 Aug 2003 07:46:41 -0000 1.2 *************** *** 31,35 **** import dbhash import whichdb ! import bsddb3 def main(): --- 31,41 ---- import dbhash import whichdb ! try: ! import bsddb ! except ImportError: ! try: ! import bsddb3 as bsddb ! except ImportError: ! bsddb = None def main(): *************** *** 53,64 **** print "Dbhash is not available." ! db = bsddb3.hashopen("bsddb3", "c") ! db["1"] = "1" ! db.close() ! str = whichdb.whichdb("bsddb3") if str == "dbhash": ! print "Bsddb3 is available." else: ! print "Bsddb3 is not available." print --- 59,73 ---- print "Dbhash is not available." ! if bsddb is None: ! str = "" ! else: ! db = bsddb.hashopen("bsddb3", "c") ! db["1"] = "1" ! db.close() ! str = whichdb.whichdb("bsddb3") if str == "dbhash": ! print "Bsddb[3] is available." else: ! print "Bsddb[3] is not available." print From montanaro at users.sourceforge.net Sat Aug 16 07:39:19 2003 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Sat Aug 16 09:39:28 2003 Subject: [Spambayes-checkins] website quotes.ht,1.3,1.4 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv30218 Modified Files: quotes.ht Log Message: markup typo Index: quotes.ht =================================================================== RCS file: /cvsroot/spambayes/website/quotes.ht,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** quotes.ht 16 Aug 2003 07:24:32 -0000 1.3 --- quotes.ht 16 Aug 2003 13:39:17 -0000 1.4 *************** *** 47,51 ****

    ! Now you know a simple way to regain absolute control of your Inbox/i> Corey Nachreiner in "Keep Spam at Bay with SpamBayes", a WatchGuard LiveSecurity column

    --- 47,51 ----

    ! Now you know a simple way to regain absolute control of your Inbox Corey Nachreiner in "Keep Spam at Bay with SpamBayes", a WatchGuard LiveSecurity column

    From xenogeist at users.sourceforge.net Sun Aug 17 15:09:02 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 17 17:09:05 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rcparser.py, 1.4, 1.5 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv15486/Outlook2000/dialogs/resources Modified Files: rcparser.py Log Message: Ignore 0x0 in styles. VS puts that in sometimes Index: rcparser.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/rcparser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rcparser.py 14 Aug 2003 21:11:57 -0000 1.4 --- rcparser.py 17 Aug 2003 21:09:00 -0000 1.5 *************** *** 259,263 **** value = getattr(win32con,self.token) else: ! value = getattr(commctrl,self.token) if Not: list.append("NOT "+self.token) --- 259,266 ---- value = getattr(win32con,self.token) else: ! if self.token in commctrl.__dict__: ! value = getattr(commctrl,self.token) ! else: ! value = 0 if Not: list.append("NOT "+self.token) From xenogeist at users.sourceforge.net Sun Aug 17 15:12:14 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 17 17:12:16 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs opt_processors.py, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv16022/Outlook2000/dialogs Modified Files: opt_processors.py Log Message: Fixed (unreported) bug where combo box options would not save. Index: opt_processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/opt_processors.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** opt_processors.py 11 Aug 2003 12:19:08 -0000 1.3 --- opt_processors.py 17 Aug 2003 21:12:11 -0000 1.4 *************** *** 73,76 **** --- 73,80 ---- # A "Combo" processor, that loads valid strings from the option. class ComboProcessor(OptionControlProcessor): + def OnCommand(self, wparam, lparam): + code = win32api.HIWORD(wparam) + if code == win32con.CBN_SELCHANGE: + self.UpdateValue_FromControl() def UpdateControl_FromValue(self): # First load the combo options. From xenogeist at users.sourceforge.net Sun Aug 17 15:14:40 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 17 17:14:44 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dlgcore.py, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv16483/Outlook2000/dialogs Modified Files: dlgcore.py Log Message: Added support for modeless dialogs and property pages. Dialogs will close the tooltip in OnDestroy as well. Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dlgcore.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dlgcore.py 13 Aug 2003 13:40:47 -0000 1.3 --- dlgcore.py 17 Aug 2003 21:14:37 -0000 1.4 *************** *** 83,87 **** def CreateWindow(self): ! self._DoCreate(win32gui.CreateDialogIndirect) def DoModal(self): --- 83,87 ---- def CreateWindow(self): ! return self._DoCreate(win32gui.CreateDialogIndirect) def DoModal(self): *************** *** 152,155 **** --- 152,158 ---- self.tt.HideTooltip() + def OnDestroy(self, hwnd, msg, wparam, lparam): + self.tt.HideTooltip() + def OnHelp(self, hwnd, msg, wparam, lparam): format = "iiiiiii" *************** *** 228,231 **** --- 231,235 ---- def OnDestroy(self, hwnd, msg, wparam, lparam): #print "OnDestroy" + TooltipDialog.OnDestroy(self, hwnd, msg, wparam, lparam) self.command_processors = None self.all_processors = None *************** *** 273,277 **** print "Ignoring OnNotify for", self._GetIDName(idFrom) return ! handler.OnNotify( (hwndFrom, idFrom, code), wparam, lparam) def OnCommand(self, hwnd, msg, wparam, lparam): --- 277,281 ---- print "Ignoring OnNotify for", self._GetIDName(idFrom) return ! return handler.OnNotify( (hwndFrom, idFrom, code), wparam, lparam) def OnCommand(self, hwnd, msg, wparam, lparam): *************** *** 284,285 **** --- 288,303 ---- self.ApplyHandlingOptionValueError(handler.OnCommand, wparam, lparam) + + class ProcessorPage(ProcessorDialog): + def __init__(self, parent, manager, idd, option_handlers): + ProcessorDialog.__init__(self, parent, manager, idd,option_handlers) + def OnInitDialog(self, hwnd, msg, wparam, lparam): + self.hwnd = hwnd + # The hardcoded values are a bit of a hack. + win32gui.SetWindowPos(self.hwnd, win32con.HWND_TOP, 1, 24, 0, 0, win32con.SWP_NOSIZE) + self.LoadAllControls() + def CreateWindow(self): + # modeless. Pages should have the WS_CHILD window style + message_map = self.GetMessageMap() + return win32gui.CreateDialogIndirect(self.hinst, self.template, self.parent, message_map) + From xenogeist at users.sourceforge.net Sun Aug 17 15:15:27 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 17 17:15:30 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs __init__.py, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv16651/Outlook2000/dialogs Modified Files: __init__.py Log Message: Added support for modeless dialogs and property pages. Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** __init__.py 10 Aug 2003 07:26:49 -0000 1.3 --- __init__.py 17 Aug 2003 21:15:25 -0000 1.4 *************** *** 26,29 **** --- 26,42 ---- dlg.DoModal() + def MakePropertyPage(parent, manager, idd): + """Creates a child dialog box to use as property page in a tab control""" + if manager.dialog_parser is None: + manager.dialog_parser = LoadDialogs() + import dialog_map + commands = dialog_map.dialog_map[idd] + if not parent: + raise "Parent must be the tab control" + + import dlgcore + dlg = dlgcore.ProcessorPage(parent, manager, idd, commands) + return dlg + import dlgutils SetWaitCursor = dlgutils.SetWaitCursor From xenogeist at users.sourceforge.net Sun Aug 17 15:16:53 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 17 17:16:57 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs processors.py, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv16894/Outlook2000/dialogs Modified Files: processors.py Log Message: Added support for property pages. GetControl searches the window's grandparent for a control if it was not found in the window. Index: processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/processors.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** processors.py 15 Aug 2003 00:37:20 -0000 1.3 --- processors.py 17 Aug 2003 21:16:51 -0000 1.4 *************** *** 23,27 **** def GetControl(self, control_id = None): control_id = control_id or self.control_id ! return win32gui.GetDlgItem(self.window.hwnd, control_id) def GetPopupHelpText(self, idFrom): return None --- 23,33 ---- def GetControl(self, control_id = None): control_id = control_id or self.control_id ! try: ! h = win32gui.GetDlgItem(self.window.hwnd, control_id) ! except: ! hparent = win32gui.GetParent(self.window.hwnd) ! hparent = win32gui.GetParent(hparent) ! h = win32gui.GetDlgItem(hparent, control_id) ! return h def GetPopupHelpText(self, idFrom): return None From xenogeist at users.sourceforge.net Sun Aug 17 15:19:07 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 17 17:19:11 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.2, 1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv18534/Outlook2000/dialogs Modified Files: dialog_map.py Log Message: Dialog re-org. Added a sb logo and moved most dialogs into a tab control on the manager dialog. One thing left to do is supply a true cancel action, currently cancel and ok do the same thing. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dialog_map.py 10 Aug 2003 07:26:49 -0000 1.2 --- dialog_map.py 17 Aug 2003 21:19:05 -0000 1.3 *************** *** 6,10 **** from opt_processors import * ! from dialogs import ShowDialog # "dialog specific" processors: --- 6,10 ---- from opt_processors import * ! from dialogs import ShowDialog, MakePropertyPage # "dialog specific" processors: *************** *** 35,38 **** --- 35,60 ---- 0, db_status) + class IntProcessor(OptionControlProcessor): + def UpdateControl_FromValue(self): + win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, str(self.option.get())) + def UpdateValue_FromControl(self): + buf_size = 100 + buf = win32gui.PyMakeBuffer(buf_size) + nchars = win32gui.SendMessage(self.GetControl(), win32con.WM_GETTEXT, + buf_size, buf) + str_val = buf[:nchars] + val = int(str_val) + if val < 0 or val > 10: + raise ValueError, "Value must be between 0 and 10" + self.SetOptionValue(val) + def OnCommand(self, wparam, lparam): + code = win32api.HIWORD(wparam) + if code==win32con.EN_CHANGE: + try: + self.UpdateValue_FromControl() + except ValueError: + # They are typing - value may be currently invalid + pass + class FilterEnableProcessor(BoolButtonProcessor): def UpdateValue_FromControl(self): *************** *** 45,48 **** --- 67,116 ---- check = not not check # force bool! self.SetOptionValue(check) + + # This class will likely go away when the real options are made for + # delay timers + class MsSliderProcessor(EditNumberProcessor): + def __init__(self, window, control_ids, option): + EditNumberProcessor.__init__(self, window, control_ids, option) + def InitSlider(self): + slider = self.GetControl(self.slider_id) + win32gui.SendMessage(slider, commctrl.TBM_SETRANGE, 0, MAKELONG(0, 10)) + win32gui.SendMessage(slider, commctrl.TBM_SETLINESIZE, 0, 1) + win32gui.SendMessage(slider, commctrl.TBM_SETPAGESIZE, 0, 1) + win32gui.SendMessage(slider, commctrl.TBM_SETTICFREQ, 1, 0) + self.UpdateSlider_FromEdit() + def OnMessage(self, msg, wparam, lparam): + slider = self.GetControl(self.slider_id) + if slider == lparam: + slider_pos = win32gui.SendMessage(slider, commctrl.TBM_GETPOS, 0, 0) + slider_pos = int(slider_pos) + str_val = str(slider_pos) + edit = self.GetControl() + win32gui.SendMessage(edit, win32con.WM_SETTEXT, 0, str_val) + def UpdateSlider_FromEdit(self): + slider = self.GetControl(self.slider_id) + try: + # Get as float so we dont fail should the .0 be there, but + # then convert to int as the slider only works with ints + val = int(float(self.option.get()/1000)) + except ValueError: + return + win32gui.SendMessage(slider, commctrl.TBM_SETPOS, 1, val) + + def UpdateControl_FromValue(self): + value = self.option.get()/1000 + win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, str(value)) + self.UpdateSlider_FromEdit() + def UpdateValue_FromControl(self): + buf_size = 100 + buf = win32gui.PyMakeBuffer(buf_size) + nchars = win32gui.SendMessage(self.GetControl(), win32con.WM_GETTEXT, + buf_size, buf) + str_val = buf[:nchars] + val = int(str_val) + if val < 0 or val > 10: + raise ValueError, "Value must be between 0 and 10" + self.SetOptionValue(val*1000) + class FilterStatusProcessor(ControlProcessor): *************** *** 81,84 **** --- 149,207 ---- win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, filter_status) + class TabProcessor(ControlProcessor): + def Init(self): + self.pages = {} + self.currentPage = None + self.currentPageIndex = -1 + self.currentPageHwnd = None + self.addPage(0, "IDD_GENERAL", "General") + self.addPage(1, "IDD_FILTER_SPAM", "Spam") + self.addPage(2, "IDD_FILTER_UNSURE", "Possible Spam") + self.addPage(3, "IDD_FILTER_NOW", "Filter Now") + self.addPage(4, "IDD_TRAINING", "Training") + self.addPage(5, "IDD_ADVANCED", "Advanced") + self.switchToPage(0) + def OnNotify(self, nmhdr, wparam, lparam): + # this does not appear to be in commctrl module + selChangedCode = 5177342 + code = nmhdr[2] + if code==selChangedCode: + index = win32gui.SendMessage(self.GetControl(), commctrl.TCM_GETCURSEL, 0,0) + if index!=self.currentPageIndex: + self.switchToPage(index) + + def switchToPage(self, index): + if self.currentPageHwnd is not None: + if not self.currentPage.SaveAllControls(): + win32gui.SendMessage(self.GetControl(), commctrl.TCM_SETCURSEL, self.currentPageIndex,0) + return 1 + win32gui.DestroyWindow(self.currentPageHwnd) + self.currentPage = MakePropertyPage(self.GetControl(), self.window.manager, self.pages[index]) + self.currentPageHwnd = self.currentPage.CreateWindow() + self.currentPageIndex = index + return 0 + + def addPage(self, item, idName, label): + format = "iiiiiii" + lbuf = win32gui.PyMakeBuffer(len(label)+1) + address,l = win32gui.PyGetBufferAddressAndLen(lbuf) + win32gui.PySetString(address, label) + + buf = struct.pack(format, + commctrl.TCIF_TEXT, # mask + 0, # state + 0, # state mask + address, + 0, #unused + 0, #image + item + ) + item = win32gui.SendMessage(self.GetControl(), + commctrl.TCM_INSERTITEM, + item, + buf) + self.pages[item] = idName + + def ShowAbout(mgr): mgr.ShowHtml("about.html") *************** *** 107,112 **** --- 230,240 ---- dialog_map = { "IDD_MANAGER" : ( + (ImageProcessor, "IDC_LOGO_GRAPHIC"), (CloseButtonProcessor, "IDOK IDCANCEL"), + (TabProcessor, "IDC_TAB"), (VersionStringProcessor, "IDC_VERSION"), + (CommandButtonProcessor, "IDC_ABOUT_BTN", ShowAbout, ()), + ), + "IDD_GENERAL": ( (TrainingStatusProcessor, "IDC_TRAINING_STATUS"), (FilterEnableProcessor, "IDC_BUT_FILTER_ENABLE", "Filter.enabled"), *************** *** 119,126 **** (DialogCommand, "IDC_BUT_FILTER_DEFINE", "IDD_FILTER"), (DialogCommand, "IDC_BUT_TRAIN_NOW", "IDD_TRAINING"), ! (CommandButtonProcessor, "IDC_BUT_ABOUT", ShowAbout, ()), ! ), "IDD_FILTER_NOW" : ( - (CloseButtonProcessor, "IDOK IDCANCEL"), (BoolButtonProcessor, "IDC_BUT_UNREAD", "Filter_Now.only_unread"), (BoolButtonProcessor, "IDC_BUT_UNSEEN", "Filter_Now.only_unseen"), --- 247,254 ---- (DialogCommand, "IDC_BUT_FILTER_DEFINE", "IDD_FILTER"), (DialogCommand, "IDC_BUT_TRAIN_NOW", "IDD_TRAINING"), ! (DialogCommand, "IDC_ADVANCED_BTN", "IDD_ADVANCED"), ! (BoolButtonProcessor, "IDC_SAVE_SPAM_SCORE", "Filter.save_spam_info"), ! ), "IDD_FILTER_NOW" : ( (BoolButtonProcessor, "IDC_BUT_UNREAD", "Filter_Now.only_unread"), (BoolButtonProcessor, "IDC_BUT_UNSEEN", "Filter_Now.only_unseen"), *************** *** 132,150 **** (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", filter.filterer, "Start Filtering", "Stop Filtering", ! "IDC_BUT_UNSEEN IDC_BUT_UNREAD IDC_BROWSE " \ ! "IDOK IDC_BUT_ACT_SCORE IDC_BUT_ACT_ALL"), ), ! "IDD_FILTER" : ( ! (CloseButtonProcessor, "IDOK IDCANCEL"), (FolderIDProcessor, "IDC_FOLDER_WATCH IDC_BROWSE_WATCH", "Filter.watch_folder_ids", "Filter.watch_include_sub"), (ComboProcessor, "IDC_ACTION_CERTAIN", "Filter.spam_action"), - (FolderIDProcessor, "IDC_FOLDER_CERTAIN IDC_BROWSE_CERTAIN", "Filter.spam_folder_id"), (EditNumberProcessor, "IDC_EDIT_CERTAIN IDC_SLIDER_CERTAIN", "Filter.spam_threshold"), ! (FolderIDProcessor, "IDC_FOLDER_UNSURE IDC_BROWSE_UNSURE", "Filter.unsure_folder_id"), --- 260,278 ---- (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", filter.filterer, "Start Filtering", "Stop Filtering", ! "IDOK IDCANCEL IDC_TAB IDC_BUT_UNSEEN IDC_BUT_UNREAD IDC_BROWSE " \ ! "IDC_BUT_ACT_SCORE IDC_BUT_ACT_ALL"), ), ! "IDD_FILTER_SPAM" : ( (FolderIDProcessor, "IDC_FOLDER_WATCH IDC_BROWSE_WATCH", "Filter.watch_folder_ids", "Filter.watch_include_sub"), (ComboProcessor, "IDC_ACTION_CERTAIN", "Filter.spam_action"), (FolderIDProcessor, "IDC_FOLDER_CERTAIN IDC_BROWSE_CERTAIN", "Filter.spam_folder_id"), (EditNumberProcessor, "IDC_EDIT_CERTAIN IDC_SLIDER_CERTAIN", "Filter.spam_threshold"), ! (BoolButtonProcessor, "IDC_MARK_SPAM_AS_READ", "Filter.spam_mark_as_read"), ! ), ! "IDD_FILTER_UNSURE" : ( (FolderIDProcessor, "IDC_FOLDER_UNSURE IDC_BROWSE_UNSURE", "Filter.unsure_folder_id"), *************** *** 153,160 **** (ComboProcessor, "IDC_ACTION_UNSURE", "Filter.unsure_action"), ! (DialogCommand, "IDC_BUT_FILTER_NOW", "IDD_FILTER_NOW"), ! ), "IDD_TRAINING" : ( - (CloseButtonProcessor, "IDOK IDCANCEL"), (FolderIDProcessor, "IDC_STATIC_HAM IDC_BROWSE_HAM", "Training.ham_folder_ids", --- 281,287 ---- (ComboProcessor, "IDC_ACTION_UNSURE", "Filter.unsure_action"), ! (BoolButtonProcessor, "IDC_MARK_UNSURE_AS_READ", "Filter.unsure_mark_as_read"), ! ), "IDD_TRAINING" : ( (FolderIDProcessor, "IDC_STATIC_HAM IDC_BROWSE_HAM", "Training.ham_folder_ids", *************** *** 167,172 **** (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", train.trainer, "Start Training", "Stop", ! "IDC_BROWSE_HAM IDC_BROWSE_SPAM " \ "IDC_BUT_REBUILD IDC_BUT_RESCORE"), ! ) } --- 294,307 ---- (AsyncCommandProcessor, "IDC_START IDC_PROGRESS IDC_PROGRESS_TEXT", train.trainer, "Start Training", "Stop", ! "IDOK IDCANCEL IDC_TAB IDC_BROWSE_HAM IDC_BROWSE_SPAM " \ "IDC_BUT_REBUILD IDC_BUT_RESCORE"), ! ), ! "IDD_ADVANCED" : ( ! (IntProcessor, "IDC_VERBOSE_LOG", "General.verbose"), ! (MsSliderProcessor, "IDC_DELAY1_TEXT IDC_DELAY1_SLIDER", "Experimental.timer_start_delay"), ! (MsSliderProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Experimental.timer_interval"), ! (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Experimental.timer_only_receive_folders"), ! (ComboProcessor, "IDC_DEL_SPAM_RS", "General.delete_as_spam_message_state"), ! (ComboProcessor, "IDC_RECOVER_RS", "General.recover_from_spam_message_state"), ! ) } From xenogeist at users.sourceforge.net Sun Aug 17 15:19:08 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 17 17:19:15 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources sblogo.bmp, NONE, 1.1 dialogs.h, 1.2, 1.3 dialogs.rc, 1.2, 1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv18534/Outlook2000/dialogs/resources Modified Files: dialogs.h dialogs.rc Added Files: sblogo.bmp Log Message: Dialog re-org. Added a sb logo and moved most dialogs into a tab control on the manager dialog. One thing left to do is supply a true cancel action, currently cancel and ok do the same thing. --- NEW FILE: sblogo.bmp --- (This appears to be a binary file; contents omitted.) Index: dialogs.h =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dialogs.h 10 Aug 2003 07:26:50 -0000 1.2 --- dialogs.h 17 Aug 2003 21:19:05 -0000 1.3 *************** *** 1,4 **** //{{NO_DEPENDENCIES}} ! // Microsoft Developer Studio generated include file. // Used by dialogs.rc // --- 1,4 ---- //{{NO_DEPENDENCIES}} ! // Microsoft Visual C++ generated include file. // Used by dialogs.rc // *************** *** 8,11 **** --- 8,17 ---- #define IDD_FILTER_NOW 104 #define IDD_FOLDER_SELECTOR 105 + #define IDD_ADVANCED 106 + #define IDB_BITMAP1 107 + #define IDD_GENERAL 108 + #define IDD_FILTER_FOLDERS 109 + #define IDD_FILTER_SPAM 110 + #define IDD_FILTER_UNSURE 111 #define IDC_PROGRESS 1000 #define IDC_PROGRESS_TEXT 1001 *************** *** 53,56 **** --- 59,82 ---- #define IDC_STATUS1 1043 #define IDC_STATUS2 1044 + #define IDC_MARK_SPAM_AS_READ 1048 + #define IDC_SAVE_SPAM_SCORE 1050 + #define IDC_MARK_UNSURE_AS_READ 1051 + #define IDC_ADVANCED_BTN 1055 + #define IDC_DELAY1_SLIDER 1056 + #define IDC_DELAY1_TEXT 1057 + #define IDC_DELAY2_SLIDER 1058 + #define IDC_DELAY2_TEXT 1059 + #define IDC_INBOX_TIMER_ONLY 1060 + #define IDC_VERBOSE_LOG 1061 + #define IDB_SBLOGO 1062 + #define IDC_LOGO_GRAPHIC 1063 + #define IDC_USE_DELAY1 1064 + #define IDC_USE_DELAY2 1065 + #define IDC_TAB 1068 + #define IDC_BUTTON1 1069 + #define IDC_ABOUT_BTN 1070 + #define IDC_DEL_SPAM_RS 1071 + #define IDC_RECOVER_RS 1072 + #define IDC_EDIT1 1073 // Next default values for new objects *************** *** 58,64 **** #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 106 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1045 #define _APS_NEXT_SYMED_VALUE 101 #endif --- 84,90 ---- #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 112 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1074 #define _APS_NEXT_SYMED_VALUE 101 #endif Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dialogs.rc 10 Aug 2003 07:26:50 -0000 1.2 --- dialogs.rc 17 Aug 2003 21:19:05 -0000 1.3 *************** *** 1,3 **** ! //Microsoft Developer Studio generated resource script. // #include "dialogs.h" --- 1,3 ---- ! // Microsoft Visual C++ generated resource script. // #include "dialogs.h" *************** *** 15,18 **** --- 15,197 ---- ///////////////////////////////////////////////////////////////////////////// + // English (U.S.) resources + + #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) + #ifdef _WIN32 + LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + #pragma code_page(1252) + #endif //_WIN32 + + ///////////////////////////////////////////////////////////////////////////// + // + // Dialog + // + + IDD_ADVANCED DIALOGEX 0, 0, 248, 185 + STYLE DS_SETFONT | WS_CHILD | WS_SYSMENU + EXSTYLE WS_EX_CONTEXTHELP + FONT 8, "Tahoma", 400, 0, 0x0 + BEGIN + GROUPBOX "Filter timer",IDC_STATIC,7,0,234,104 + CONTROL "",IDC_DELAY1_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | + TBS_TOP | WS_TABSTOP,16,18,148,22 + LTEXT "Processing start delay",IDC_STATIC,14,9,101,8 + EDITTEXT IDC_DELAY1_TEXT,165,25,40,14,ES_AUTOHSCROLL + LTEXT "seconds",IDC_STATIC,208,27,28,8 + CONTROL "",IDC_DELAY2_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | + TBS_TOP | WS_TABSTOP,16,60,148,22 + LTEXT "Delay between new mail check",IDC_STATIC,14,47,101,8 + EDITTEXT IDC_DELAY2_TEXT,165,69,40,14,ES_AUTOHSCROLL + LTEXT "seconds",IDC_STATIC,207,69,28,8 + CONTROL "Timer only applies to Inbox",IDC_INBOX_TIMER_ONLY, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,89,104,10 + GROUPBOX "Read States",IDC_STATIC,7,104,234,63 + LTEXT "When a message is deleted as spam, change its read state to", + IDC_STATIC,17,115,198,8 + LTEXT "When a message is recovered from spam, change its read state to", + IDC_STATIC,14,139,214,8 + COMBOBOX IDC_DEL_SPAM_RS,25,124,97,54,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_RECOVER_RS,25,149,97,63,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + LTEXT "Log Level",IDC_STATIC,7,174,31,8 + EDITTEXT IDC_VERBOSE_LOG,45,171,40,14,ES_AUTOHSCROLL + END + + IDD_MANAGER DIALOGEX 0, 0, 275, 291 + STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU + EXSTYLE WS_EX_CONTEXTHELP + CAPTION "SpamBayes" + FONT 8, "Tahoma", 400, 0, 0x0 + BEGIN + DEFPUSHBUTTON "OK",IDOK,158,270,50,14 + PUSHBUTTON "Cancel",IDCANCEL,216,270,50,14 + CONTROL 1062,IDC_LOGO_GRAPHIC,"Static",SS_BITMAP | + SS_REALSIZEIMAGE,0,0,275,52 + CONTROL "",IDC_TAB,"SysTabControl32",0x0,9,64,255,202 + LTEXT "SpamBayes Version Here",IDC_VERSION,14,55,238,8 + PUSHBUTTON "About",IDC_ABOUT_BTN,9,270,50,14 + END + + IDD_FILTER_FOLDERS DIALOGEX 0, 0, 244, 183 + STYLE DS_SETFONT | WS_CHILD | WS_SYSMENU + FONT 8, "Tahoma", 400, 0, 0x0 + BEGIN + LTEXT "Filter the following folders as messages arrive", + IDC_STATIC,11,9,168,11 + CONTROL "Folder names...\nLine 2",IDC_FOLDER_WATCH,"Static", + SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | + WS_GROUP,10,20,177,12 + PUSHBUTTON "Browse...",IDC_BROWSE_WATCH,187,19,50,14 + END + + IDD_FILTER_SPAM DIALOGEX 0, 0, 251, 147 + STYLE DS_SETFONT | WS_CHILD | WS_SYSMENU + FONT 8, "Tahoma", 400, 0, 0x0 + BEGIN + LTEXT "Filter the following folders as messages arrive", + IDC_STATIC,8,9,168,11 + CONTROL "Folder names...\nLine 2",IDC_FOLDER_WATCH,"Static", + SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | + WS_GROUP,7,20,177,12 + PUSHBUTTON "Browse...",IDC_BROWSE_WATCH,192,19,50,14 + GROUPBOX "Certain Spam",IDC_STATIC,7,43,235,80 + LTEXT "To be considered certain spam, a message must score at least", + IDC_STATIC,13,52,212,10 + CONTROL "",IDC_SLIDER_CERTAIN,"msctls_trackbar32",TBS_AUTOTICKS | + TBS_TOP | WS_TABSTOP,13,62,165,22 + EDITTEXT IDC_EDIT_CERTAIN,184,63,51,14,ES_AUTOHSCROLL + LTEXT "and these mesages should be:",IDC_STATIC,13,82,107,10 + COMBOBOX IDC_ACTION_CERTAIN,13,93,55,40,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "to folder",IDC_STATIC,75,95,31,10 + CONTROL "Folder names...",IDC_FOLDER_CERTAIN,"Static", + SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | + WS_GROUP,120,93,59,14 + PUSHBUTTON "Browse",IDC_BROWSE_CERTAIN,184,93,50,14 + CONTROL "Mark spam as read",IDC_MARK_SPAM_AS_READ,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,13,110,81,10 + END + + IDD_FILTER_UNSURE DIALOGEX 0, 0, 249, 124 + STYLE DS_SETFONT | WS_CHILD | WS_SYSMENU + FONT 8, "Tahoma", 400, 0, 0x0 + BEGIN + LTEXT "To be considered uncertain, a message must score at least", + IDC_STATIC,12,11,212,10 + CONTROL "",IDC_SLIDER_UNSURE,"msctls_trackbar32",TBS_AUTOTICKS | + TBS_TOP | WS_TABSTOP,12,18,165,20 + EDITTEXT IDC_EDIT_UNSURE,183,24,54,14,ES_AUTOHSCROLL + LTEXT "and these mesages should be:",IDC_STATIC,12,38,107,10 + COMBOBOX IDC_ACTION_UNSURE,12,49,55,40,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + LTEXT "to folder",IDC_STATIC,74,52,31,10 + CONTROL "(folder name)",IDC_FOLDER_UNSURE,"Static", + SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | + WS_GROUP,119,49,59,14 + PUSHBUTTON "&Browse",IDC_BROWSE_UNSURE,183,49,50,14 + CONTROL "Mark posiible spam as read",IDC_MARK_UNSURE_AS_READ, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,70,101,10 + END + + + ///////////////////////////////////////////////////////////////////////////// + // + // DESIGNINFO + // + + #ifdef APSTUDIO_INVOKED + GUIDELINES DESIGNINFO + BEGIN + IDD_ADVANCED, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 241 + BOTTOMMARGIN, 180 + END + + IDD_MANAGER, DIALOG + BEGIN + BOTTOMMARGIN, 284 + END + + IDD_FILTER_FOLDERS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 237 + TOPMARGIN, 7 + BOTTOMMARGIN, 176 + END + + IDD_FILTER_SPAM, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 244 + TOPMARGIN, 7 + BOTTOMMARGIN, 140 + END + + IDD_FILTER_UNSURE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 242 + TOPMARGIN, 7 + BOTTOMMARGIN, 117 + END + END + #endif // APSTUDIO_INVOKED + + + ///////////////////////////////////////////////////////////////////////////// + // + // Bitmap + // + + IDB_SBLOGO BITMAP "sblogo.bmp" + #endif // English (U.S.) resources + ///////////////////////////////////////////////////////////////////////////// + + + ///////////////////////////////////////////////////////////////////////////// // English (Australia) resources *************** *** 28,73 **** // ! IDD_MANAGER DIALOGEX 0, 0, 242, 201 ! STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP - CAPTION "SpamBayes" FONT 8, "Tahoma", 0, 0, 0x1 BEGIN ! CONTROL "SpamBayes version xxx",IDC_VERSION,"Static", ! SS_LEFTNOWORDWRAP | WS_GROUP,8,4,230,11 ! GROUPBOX "Training",IDC_STATIC,8,17,227,103 ! LTEXT "Training is the process of giving examples of both good and bad email to the system so it can classify future email", ! IDC_STATIC,17,27,215,17 LTEXT "Automatically train that a message is good when:", ! IDC_STATIC,15,50,208,10 CONTROL "It is moved from a spam folder back to the Inbox", IDC_BUT_TRAIN_FROM_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,20,60,204,9 LTEXT "Automatically train that a message is spam when:", ! IDC_STATIC,15,74,208,10 CONTROL "It is moved to the certain-spam folder", IDC_BUT_TRAIN_TO_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,20,85,204,9 CONTROL "123 spam messages; 456 good messages", IDC_TRAINING_STATUS,"Static",SS_LEFTNOWORDWRAP | ! SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,15,98,146,14 ! PUSHBUTTON "Train Now...",IDC_BUT_TRAIN_NOW,167,98,63,14 ! GROUPBOX "Filtering",IDC_STATIC,7,122,228,57 LTEXT "Filtering defines how spam is handled as it arrives", ! IDC_STATIC,15,131,202,8 CONTROL "Enable &Filtering",IDC_BUT_FILTER_ENABLE,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,20,143,120,11 LTEXT "Certain spam is moved to Folder1\nPossible spam is moved too", ! IDC_FILTER_STATUS,15,157,146,18,SS_SUNKEN ! PUSHBUTTON "Filter Now...",IDC_BUT_FILTER_NOW,167,141,63,14 ! PUSHBUTTON "Define Filters...",IDC_BUT_FILTER_DEFINE,167,160,63,14 ! PUSHBUTTON "About...",IDC_BUT_ABOUT,99,184,62,14 ! DEFPUSHBUTTON "Close",IDOK,167,184,62,14 END IDD_TRAINING DIALOGEX 0, 0, 241, 140 ! STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP - CAPTION "Training" FONT 8, "Tahoma", 0, 0, 0x1 BEGIN --- 207,245 ---- // ! IDD_GENERAL DIALOGEX 0, 0, 253, 172 ! STYLE DS_SETFONT | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTEXTHELP FONT 8, "Tahoma", 0, 0, 0x1 BEGIN ! GROUPBOX "Training",IDC_STATIC,8,2,240,103 ! LTEXT "Training is the process of giving examples of both good and bad email to the system so it can classify future email.", ! IDC_STATIC,17,12,222,17 LTEXT "Automatically train that a message is good when:", ! IDC_STATIC,15,35,208,10 CONTROL "It is moved from a spam folder back to the Inbox", IDC_BUT_TRAIN_FROM_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,17,45,204,9 LTEXT "Automatically train that a message is spam when:", ! IDC_STATIC,15,59,208,10 CONTROL "It is moved to the certain-spam folder", IDC_BUT_TRAIN_TO_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,17,70,204,9 CONTROL "123 spam messages; 456 good messages", IDC_TRAINING_STATUS,"Static",SS_LEFTNOWORDWRAP | ! SS_CENTERIMAGE | SS_SUNKEN | WS_GROUP,15,83,223,14 ! GROUPBOX "Filtering",IDC_STATIC,7,107,241,60 LTEXT "Filtering defines how spam is handled as it arrives", ! IDC_STATIC,15,117,205,8 CONTROL "Enable &Filtering",IDC_BUT_FILTER_ENABLE,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,15,128,66,11 LTEXT "Certain spam is moved to Folder1\nPossible spam is moved too", ! IDC_FILTER_STATUS,15,143,223,18,SS_SUNKEN ! CONTROL "Save Spam Score",IDC_SAVE_SPAM_SCORE,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,165,128,72,10 END IDD_TRAINING DIALOGEX 0, 0, 241, 140 ! STYLE DS_SETFONT | WS_CHILD | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP FONT 8, "Tahoma", 0, 0, 0x1 BEGIN *************** *** 90,100 **** 92,166,11 LTEXT "",IDC_PROGRESS_TEXT,7,108,227,10 - DEFPUSHBUTTON "Close",IDOK,184,119,50,14 END ! IDD_FILTER_NOW DIALOGEX 0, 0, 244, 182 ! STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP - CAPTION "Filter Now" FONT 8, "Tahoma", 0, 0, 0x1 BEGIN --- 262,270 ---- 92,166,11 LTEXT "",IDC_PROGRESS_TEXT,7,108,227,10 END ! IDD_FILTER_NOW DIALOGEX 0, 0, 244, 178 ! STYLE DS_SETFONT | WS_CHILD | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP FONT 8, "Tahoma", 0, 0, 0x1 BEGIN *************** *** 119,129 **** LTEXT "Static",IDC_PROGRESS_TEXT,7,144,227,10 PUSHBUTTON "Filter Now",IDC_START,7,161,50,14 - DEFPUSHBUTTON "Close",IDOK,187,161,50,14 END ! IDD_FILTER DIALOGEX 0, 0, 249, 239 ! STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP - CAPTION "Filter Rules" FONT 8, "Tahoma", 0, 0, 0x1 BEGIN --- 289,297 ---- LTEXT "Static",IDC_PROGRESS_TEXT,7,144,227,10 PUSHBUTTON "Filter Now",IDC_START,7,161,50,14 END ! IDD_FILTER DIALOGEX 0, 0, 249, 252 ! STYLE DS_SETFONT | WS_CHILD | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP FONT 8, "Tahoma", 0, 0, 0x1 BEGIN *************** *** 134,174 **** WS_GROUP,7,20,177,12 PUSHBUTTON "Browse...",IDC_BROWSE_WATCH,192,19,50,14 ! GROUPBOX "Certain Spam",IDC_STATIC,7,43,235,65 LTEXT "To be considered certain spam, a message must score at least", IDC_STATIC,13,52,212,10 CONTROL "Slider1",IDC_SLIDER_CERTAIN,"msctls_trackbar32", ! TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,13,62,165,12 EDITTEXT IDC_EDIT_CERTAIN,184,63,51,14,ES_AUTOHSCROLL ! LTEXT "and these mesages should be:",IDC_STATIC,13,76,107,10 ! COMBOBOX IDC_ACTION_CERTAIN,13,88,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "to folder",IDC_STATIC,75,90,31,10 CONTROL "Folder names...",IDC_FOLDER_CERTAIN,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | ! WS_GROUP,120,88,59,14 ! PUSHBUTTON "Browse",IDC_BROWSE_CERTAIN,184,88,50,14 ! GROUPBOX "Possible Spam",IDC_STATIC,7,114,235,68 LTEXT "To be considered uncertain, a message must score at least", ! IDC_STATIC,13,124,212,10 CONTROL "Slider1",IDC_SLIDER_UNSURE,"msctls_trackbar32", ! TBS_AUTOTICKS | TBS_BOTH | WS_TABSTOP,13,137,165,12 ! EDITTEXT IDC_EDIT_UNSURE,184,137,54,14,ES_AUTOHSCROLL ! LTEXT "and these mesages should be:",IDC_STATIC,13,150,107,10 ! COMBOBOX IDC_ACTION_UNSURE,13,161,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "to folder",IDC_STATIC,75,164,31,10 CONTROL "(folder name)",IDC_FOLDER_UNSURE,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | ! WS_GROUP,120,161,59,14 ! PUSHBUTTON "&Browse",IDC_BROWSE_UNSURE,184,161,50,14 ! GROUPBOX "Good messages",IDC_STATIC,7,185,235,25 LTEXT "All other messages are considered good, and are not filtered", ! IDC_STATIC,14,196,212,10 ! PUSHBUTTON "Filter Now...",IDC_BUT_FILTER_NOW,7,218,50,14 ! PUSHBUTTON "Close",IDOK,192,218,50,14 END ! IDD_FOLDER_SELECTOR DIALOG DISCARDABLE 0, 0, 247, 215 ! STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Dialog" FONT 8, "Tahoma" --- 302,344 ---- WS_GROUP,7,20,177,12 PUSHBUTTON "Browse...",IDC_BROWSE_WATCH,192,19,50,14 ! GROUPBOX "Certain Spam",IDC_STATIC,7,43,235,80 LTEXT "To be considered certain spam, a message must score at least", IDC_STATIC,13,52,212,10 CONTROL "Slider1",IDC_SLIDER_CERTAIN,"msctls_trackbar32", ! TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,13,62,165,22 EDITTEXT IDC_EDIT_CERTAIN,184,63,51,14,ES_AUTOHSCROLL ! LTEXT "and these mesages should be:",IDC_STATIC,13,82,107,10 ! COMBOBOX IDC_ACTION_CERTAIN,13,93,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "to folder",IDC_STATIC,75,95,31,10 CONTROL "Folder names...",IDC_FOLDER_CERTAIN,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | ! WS_GROUP,120,93,59,14 ! PUSHBUTTON "Browse",IDC_BROWSE_CERTAIN,184,93,50,14 ! GROUPBOX "Possible Spam",IDC_STATIC,6,127,235,81 LTEXT "To be considered uncertain, a message must score at least", ! IDC_STATIC,12,138,212,10 CONTROL "Slider1",IDC_SLIDER_UNSURE,"msctls_trackbar32", ! TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,12,145,165,20 ! EDITTEXT IDC_EDIT_UNSURE,183,151,54,14,ES_AUTOHSCROLL ! LTEXT "and these mesages should be:",IDC_STATIC,12,165,107,10 ! COMBOBOX IDC_ACTION_UNSURE,12,176,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "to folder",IDC_STATIC,74,179,31,10 CONTROL "(folder name)",IDC_FOLDER_UNSURE,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | ! WS_GROUP,119,176,59,14 ! PUSHBUTTON "&Browse",IDC_BROWSE_UNSURE,183,176,50,14 ! GROUPBOX "Good messages",IDC_STATIC,9,212,235,25 LTEXT "All other messages are considered good, and are not filtered", ! IDC_STATIC,16,223,212,10 ! CONTROL "Mark spam as read",IDC_MARK_SPAM_AS_READ,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,13,110,81,10 ! CONTROL "Mark posiible spam as read",IDC_MARK_UNSURE_AS_READ, ! "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,196,101,10 END ! IDD_FOLDER_SELECTOR DIALOG 0, 0, 247, 215 ! STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Dialog" FONT 8, "Tahoma" *************** *** 189,192 **** --- 359,385 ---- + ///////////////////////////////////////////////////////////////////////////// + // + // DESIGNINFO + // + + #ifdef APSTUDIO_INVOKED + GUIDELINES DESIGNINFO + BEGIN + IDD_GENERAL, DIALOG + BEGIN + RIGHTMARGIN, 248 + BOTTOMMARGIN, 167 + END + + IDD_FILTER, DIALOG + BEGIN + BOTTOMMARGIN, 244 + HORZGUIDE, 127 + END + END + #endif // APSTUDIO_INVOKED + + #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// *************** *** 195,204 **** // ! 1 TEXTINCLUDE DISCARDABLE BEGIN "dialogs.h\0" END ! 2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""winres.h""\r\n" --- 388,397 ---- // ! 1 TEXTINCLUDE BEGIN "dialogs.h\0" END ! 2 TEXTINCLUDE BEGIN "#include ""winres.h""\r\n" *************** *** 207,211 **** END ! 3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" --- 400,404 ---- END ! 3 TEXTINCLUDE BEGIN "\r\n" From xenogeist at users.sourceforge.net Sun Aug 17 17:08:42 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 17 19:08:49 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv5117/Outlook2000/dialogs/resources Modified Files: dialogs.rc Log Message: Made the dropdowns droplists on the advanced page. Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dialogs.rc 17 Aug 2003 21:19:05 -0000 1.3 --- dialogs.rc 17 Aug 2003 23:08:40 -0000 1.4 *************** *** 51,57 **** LTEXT "When a message is recovered from spam, change its read state to", IDC_STATIC,14,139,214,8 ! COMBOBOX IDC_DEL_SPAM_RS,25,124,97,54,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP ! COMBOBOX IDC_RECOVER_RS,25,149,97,63,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Log Level",IDC_STATIC,7,174,31,8 --- 51,57 ---- LTEXT "When a message is recovered from spam, change its read state to", IDC_STATIC,14,139,214,8 ! COMBOBOX IDC_DEL_SPAM_RS,25,124,97,54,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP ! COMBOBOX IDC_RECOVER_RS,25,149,97,63,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Log Level",IDC_STATIC,7,174,31,8 From xenogeist at users.sourceforge.net Sun Aug 17 17:10:32 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Sun Aug 17 19:10:34 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv5416/Outlook2000/dialogs Modified Files: dialog_map.py Log Message: Moved training to be the second tab. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dialog_map.py 17 Aug 2003 21:19:05 -0000 1.3 --- dialog_map.py 17 Aug 2003 23:10:30 -0000 1.4 *************** *** 156,163 **** self.currentPageHwnd = None self.addPage(0, "IDD_GENERAL", "General") ! self.addPage(1, "IDD_FILTER_SPAM", "Spam") ! self.addPage(2, "IDD_FILTER_UNSURE", "Possible Spam") ! self.addPage(3, "IDD_FILTER_NOW", "Filter Now") ! self.addPage(4, "IDD_TRAINING", "Training") self.addPage(5, "IDD_ADVANCED", "Advanced") self.switchToPage(0) --- 156,163 ---- self.currentPageHwnd = None self.addPage(0, "IDD_GENERAL", "General") ! self.addPage(1, "IDD_TRAINING", "Training") ! self.addPage(2, "IDD_FILTER_SPAM", "Spam") ! self.addPage(3, "IDD_FILTER_UNSURE", "Possible Spam") ! self.addPage(4, "IDD_FILTER_NOW", "Filter Now") self.addPage(5, "IDD_ADVANCED", "Advanced") self.switchToPage(0) From anadelonbrin at users.sourceforge.net Sun Aug 17 17:46:58 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Aug 17 19:47:04 2003 Subject: [Spambayes-checkins] website faq.txt,1.35,1.36 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv11673 Modified Files: faq.txt Log Message: Add more information about identifying dumbdbm, as suggested by Peter Beckman. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** faq.txt 13 Aug 2003 14:52:27 -0000 1.35 --- faq.txt 17 Aug 2003 23:46:56 -0000 1.36 *************** *** 941,948 **** as it is very inefficient. Instead, either `use a pickle <#how-do-i-use-a-pickle-for-storage>`_ or install `pybsddb`_ ! (bsddb3) and use that instead. If you are not sure which database systems you have available, and/or which one you are currently using, there is a script in the utilities folder called `which_database.py`_ that will display ! this information (Windows users should run it from a command prompt). Support for dumbdbm will be dropped in a future release. --- 941,956 ---- as it is very inefficient. Instead, either `use a pickle <#how-do-i-use-a-pickle-for-storage>`_ or install `pybsddb`_ ! (bsddb3) and use that instead. ! ! If you are not sure which database systems you have available, and/or which one you are currently using, there is a script in the utilities folder called `which_database.py`_ that will display ! this information (Windows users should run it from a command prompt). This ! file is only included in releases after 1.0a4 - if you are using an earlier ! version, you can download it from cvs, or just go by the name(s) of the ! database file(s). If you have a single file, probably called ``hammie.db``, ! then you are probably not using dumbdbm. If you have three files (probably ! called ``hammie.db.dir``, ``hammie.db.dat`` and ``hammie.db.bak``), then you ! most likely are using dumbdbm, and should stop. Support for dumbdbm will be dropped in a future release. From anadelonbrin at users.sourceforge.net Sun Aug 17 18:53:14 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Aug 17 20:53:17 2003 Subject: [Spambayes-checkins] spambayes/spambayes ImapUI.py, 1.14, 1.15 ProxyUI.py, 1.14, 1.15 UserInterface.py, 1.14, 1.15 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv20254/spambayes Modified Files: ImapUI.py ProxyUI.py UserInterface.py Log Message: Add version information to the web interface, as requested in [ spambayes-Bugs-790051 ] Can't review messages if probability header is turned on Index: ImapUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ImapUI.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ImapUI.py 17 Jun 2003 07:36:49 -0000 1.14 --- ImapUI.py 18 Aug 2003 00:53:11 -0000 1.15 *************** *** 98,101 **** --- 98,102 ---- self.imap_pwd = pwd self.imap_logged_in = False + self.app_for_version = "IMAP Filter" def onHome(self): Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ProxyUI.py 12 Aug 2003 04:41:46 -0000 1.14 --- ProxyUI.py 18 Aug 2003 00:53:11 -0000 1.15 *************** *** 118,121 **** --- 118,122 ---- state = proxy_state self.state_recreator = state_recreator # ugly + self.app_for_version = "POP3 Proxy" def onHome(self): Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** UserInterface.py 12 Aug 2003 05:51:55 -0000 1.14 --- UserInterface.py 18 Aug 2003 00:53:11 -0000 1.15 *************** *** 74,77 **** --- 74,78 ---- import PyMeldLite + import Version import Dibbler import tokenizer *************** *** 96,99 **** --- 97,101 ---- htmlSource, self._images = self.readUIResources() self.html = PyMeldLite.Meld(htmlSource, readonly=True) + self.app_for_version = None def onIncomingConnection(self, clientSocket): *************** *** 103,111 **** def _getHTMLClone(self): ! """Gets a clone of the HTML, with the footer timestamped, ready to be ! modified and sent to the browser.""" clone = self.html.clone() timestamp = time.strftime('%H:%M on %A %B %d %Y', time.localtime()) clone.footer.timestamp = timestamp return clone --- 105,115 ---- def _getHTMLClone(self): ! """Gets a clone of the HTML, with the footer timestamped, and ! version information added, ready to be modified and sent to the ! browser.""" clone = self.html.clone() timestamp = time.strftime('%H:%M on %A %B %d %Y', time.localtime()) clone.footer.timestamp = timestamp + clone.footer.version = Version.get_version_string(self.app_for_version) return clone From anadelonbrin at users.sourceforge.net Sun Aug 17 18:53:14 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Aug 17 20:53:23 2003 Subject: [Spambayes-checkins] spambayes/spambayes/resources ui.html, 1.15, 1.16 ui_html.py, 1.16, 1.17 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes/resources In directory sc8-pr-cvs1:/tmp/cvs-serv20254/spambayes/resources Modified Files: ui.html ui_html.py Log Message: Add version information to the web interface, as requested in [ spambayes-Bugs-790051 ] Can't review messages if probability header is turned on Index: ui.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui.html,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ui.html 7 Jul 2003 20:58:37 -0000 1.15 --- ui.html 18 Aug 2003 00:53:12 -0000 1.16 *************** *** 403,406 **** --- 403,407 ----
  • [\s]*') ! if s.search(text[id_location:]) is not None: ! id_location += s.search(text[id_location:]).end() ! s = re.compile('[\d-]+
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Option Name
    -
    Valid Values
    -
    Default
    -
    Comments
    -
    timer_start_delayNumber0Enables the use of a timer to - process messages rather than processing as they arrive.  This has - been designed to avoid problems where the plugin conflicts with - Outlook's builtin rules, causing a number of symptoms; either Outlook - rules not firing, or strange 'unread' states on the messages.  If - this value is zero, the timer is disabled, otherwise it specifies the - delay (in milliseconds) - between a new item being received in the Inbox, and SpamBayes starting - to process the items.  If another new message arrives during this - period, the timer will be reset, and the delay will start again.  - This prevents SpamBayes from becoming overwhelmed when Outlook itself - is being overwhelmed with new messages - SpamBayes will patiently wait - until the flood has stopped, and begin sorting out the Spam.
    - A reasonable starting point for this option would be 2000 (ie, every 2 - seconds), but the optimal value will vary depending on the speed of - your machine, network connection and mail server.
    -
    timer_interval
    -
    integer
    -
    1000
    -
    Once the new message timer has - actually started, how long (in milliseconds) - should it wait before checking each new message.  If a new message - arrives during this process, the entire timer process is restarted, - meaning that timer_start_delay - (above) will elapse before the process begins again.
    -
    timer_only_receive_folders
    -
    True, False
    -
    True
    -
    If you have specified that a - timer be used, this option controls if the timer is used only for - special 'Inbox' type folders (True), or for all watched folders (False).
    - The point of using a timer is to prevent the SpamBayes filter getting - in the way the builtin Outlook rules.  Therefore, is it generally - only necessary to use a timer for folders that have new items being - delivered directly to them by the server - typically, your - 'Inbox'.  Folders that are not inbox style folders generally are - not subject to builtin filtering, so generally have no problems - filtering messages in 'real time'.
    -


    Multiple Configuration Files

    There is rudimentary support for multiple configuration files.  --- 226,232 ---- more appropriate one, so you will need to change these options later.

    + This release has no experimental options.

    Multiple Configuration Files

    There is rudimentary support for multiple configuration files.  From mhammond at users.sourceforge.net Mon Aug 25 20:35:47 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 22:35:59 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.24, 1.25 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv20493/dialogs Modified Files: dialog_map.py Log Message: The experimental 'timers' options got upgraded to the 'filter' section. Existing values should be migrated (but note you won't see the migration until the config is saved - ie, after the manager dialog is shown). New values are floating point seconds (and the migration also does the conversion from the old milli-seconds). I'm too nice :) Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** dialog_map.py 25 Aug 2003 17:05:35 -0000 1.24 --- dialog_map.py 26 Aug 2003 02:35:45 -0000 1.25 *************** *** 93,142 **** self.SetOptionValue(check) - # This class will likely go away when the real options are made for - # delay timers - class MsSliderProcessor(EditNumberProcessor): - def __init__(self, window, control_ids, option): - EditNumberProcessor.__init__(self, window, control_ids, option) - def InitSlider(self): - slider = self.GetControl(self.slider_id) - win32gui.SendMessage(slider, commctrl.TBM_SETRANGE, 0, MAKELONG(0, 20)) - win32gui.SendMessage(slider, commctrl.TBM_SETLINESIZE, 0, 1) - win32gui.SendMessage(slider, commctrl.TBM_SETPAGESIZE, 0, 1) - win32gui.SendMessage(slider, commctrl.TBM_SETTICFREQ, 2, 0) - self.UpdateSlider_FromEdit() - def OnMessage(self, msg, wparam, lparam): - slider = self.GetControl(self.slider_id) - if slider == lparam: - slider_pos = win32gui.SendMessage(slider, commctrl.TBM_GETPOS, 0, 0) - slider_pos = float(slider_pos) - str_val = str(slider_pos*.5) - edit = self.GetControl() - win32gui.SendMessage(edit, win32con.WM_SETTEXT, 0, str_val) - def UpdateSlider_FromEdit(self): - slider = self.GetControl(self.slider_id) - try: - # Get as float so we dont fail should the .0 be there, but - # then convert to int as the slider only works with ints - val = int(float(self.option.get())/500.0) - except ValueError: - return - win32gui.SendMessage(slider, commctrl.TBM_SETPOS, 1, val) - - def UpdateControl_FromValue(self): - value = float(self.option.get())/1000.0 - win32gui.SendMessage(self.GetControl(), win32con.WM_SETTEXT, 0, str(value)) - self.UpdateSlider_FromEdit() - def UpdateValue_FromControl(self): - buf_size = 100 - buf = win32gui.PyMakeBuffer(buf_size) - nchars = win32gui.SendMessage(self.GetControl(), win32con.WM_GETTEXT, - buf_size, buf) - str_val = buf[:nchars] - val = float(str_val) - if val < 0.0 or val > 10.0: - raise ValueError, "Value must be between 0 and 10" - self.SetOptionValue(int(val*1000.0)) - - class FilterStatusProcessor(ControlProcessor): def OnOptionChanged(self, option): --- 93,96 ---- *************** *** 455,461 **** ), "IDD_ADVANCED" : ( ! (MsSliderProcessor, "IDC_DELAY1_TEXT IDC_DELAY1_SLIDER", "Experimental.timer_start_delay"), ! (MsSliderProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Experimental.timer_interval"), ! (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Experimental.timer_only_receive_folders"), (HiddenDialogCommand, "IDC_HIDDEN", "IDD_DIAGNOSTIC"), (CommandButtonProcessor, "IDC_SHOW_DATA_FOLDER", ShowDataFolder, ()), --- 409,415 ---- ), "IDD_ADVANCED" : ( ! (EditNumberProcessor, "IDC_DELAY1_TEXT IDC_DELAY1_SLIDER", "Filter.timer_start_delay", 0, 10, 20), ! (EditNumberProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Filter.timer_interval", 0, 10, 20), ! (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Filter.timer_only_receive_folders"), (HiddenDialogCommand, "IDC_HIDDEN", "IDD_DIAGNOSTIC"), (CommandButtonProcessor, "IDC_SHOW_DATA_FOLDER", ShowDataFolder, ()), From mhammond at users.sourceforge.net Mon Aug 25 20:35:47 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 22:36:07 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.98, 1.99 config.py, 1.26, 1.27 manager.py, 1.80, 1.81 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv20493 Modified Files: addin.py config.py manager.py Log Message: The experimental 'timers' options got upgraded to the 'filter' section. Existing values should be migrated (but note you won't see the migration until the config is saved - ie, after the manager dialog is shown). New values are floating point seconds (and the migration also does the conversion from the old milli-seconds). I'm too nice :) Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** addin.py 25 Aug 2003 14:29:33 -0000 1.98 --- addin.py 26 Aug 2003 02:35:45 -0000 1.99 *************** *** 290,297 **** def Init(self, *args): _BaseItemsEvent.Init(self, *args) ! ! start_delay = self.manager.config.experimental.timer_start_delay ! interval = self.manager.config.experimental.timer_interval ! use_timer = start_delay and interval if use_timer and not hasattr(timer, "__version__"): # No binaries will see this. --- 290,301 ---- def Init(self, *args): _BaseItemsEvent.Init(self, *args) ! timer_enabled = self.manager.config.filter.timer_enabled ! start_delay = self.manager.config.filter.timer_start_delay ! interval = self.manager.config.filter.timer_interval ! use_timer = timer_enabled and start_delay and interval ! if timer_enabled and not use_timer: ! print "*" * 50 ! print "The timer is enabled, but one of the timer intervals values is zero" ! print "You must set both intervals before the timer will enable" if use_timer and not hasattr(timer, "__version__"): # No binaries will see this. *************** *** 308,325 **** # the timer for known 'inbox' folders, or for all watched folders. is_inbox = self.target.IsReceiveFolder() ! if not is_inbox and self.manager.config.experimental.timer_only_receive_folders: use_timer = False ! # Good chance someone will assume timer is seconds, not ms. ! if use_timer and (start_delay < 500 or interval < 500): ! print "*" * 50 ! print "The timer is configured to fire way too often " \ "(delay=%s milliseconds, interval=%s milliseconds)" \ % (start_delay, interval) ! print "This is very high, and is likely to starve Outlook and the " ! print "SpamBayes addin. Please adjust your configuration" ! print "The timer is NOT enabled..." ! print "*" * 50 ! use_timer = False self.use_timer = use_timer --- 312,337 ---- # the timer for known 'inbox' folders, or for all watched folders. is_inbox = self.target.IsReceiveFolder() ! if not is_inbox and self.manager.config.filer.timer_only_receive_folders: use_timer = False ! # Don't allow insane values for the timer. ! if use_timer: ! too = None ! if type(start_delay) != type(0.0) or type(interval) != type(0.0): ! print "*" * 50 ! print "Timer values are garbage!", repr(start_delay), repr(interval) ! use_timer = False ! elif start_delay < 0.4 or interval < 0.4: ! too = "too often" ! elif start_delay > 30 or interval > 30: ! too = "too infrequently" ! if too: ! print "*" * 50 ! print "The timer is configured to fire way " + too + \ "(delay=%s milliseconds, interval=%s milliseconds)" \ % (start_delay, interval) ! print "Please adjust your configuration. The timer is NOT enabled..." ! print "*" * 50 ! use_timer = False self.use_timer = use_timer *************** *** 338,343 **** --- 350,357 ---- assert thread.get_ident() == self.owner_thread_ident assert self.timer_id is None, "Shouldn't start a timer when already have one" + assert type(delay)==type(0.0), "Timer values are float seconds" # And start a new timer. assert delay, "No delay means no timer!" + delay = int(delay*1000) # convert to ms. self.timer_id = timer.set_timer(delay, self._TimerFunc) self.manager.LogDebug(1, "New message timer started - id=%d, delay=%d" % (self.timer_id, delay)) *************** *** 347,351 **** self._KillTimer() # And start a new timer. ! delay = self.manager.config.experimental.timer_start_delay field_name = self.manager.config.general.field_score_name self.timer_generator = self.target.GetNewUnscoredMessageGenerator(field_name) --- 361,365 ---- self._KillTimer() # And start a new timer. ! delay = self.manager.config.filter.timer_start_delay field_name = self.manager.config.general.field_score_name self.timer_generator = self.target.GetNewUnscoredMessageGenerator(field_name) *************** *** 392,396 **** finally: # And setup the timer for the next check. ! delay = self.manager.config.experimental.timer_interval self._DoStartTimer(delay) --- 406,410 ---- finally: # And setup the timer for the next check. ! delay = self.manager.config.filter.timer_interval self._DoStartTimer(delay) *************** *** 675,678 **** --- 689,693 ---- if restore_folder is None or \ msgstore_message.GetFolder() == restore_folder: + print "Unable to determine source folder for message '%s' - restoring to Inbox" % (subject,) restore_folder = inbox_folder Index: config.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/config.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** config.py 24 Aug 2003 12:02:21 -0000 1.26 --- config.py 26 Aug 2003 02:35:45 -0000 1.27 *************** *** 110,135 **** # Experimental options may change, may get removed, and *will* get moved # should they be kept. "Experimental" : ( ! ("timer_start_delay", "The interval, (in ms) before the timer starts.", 0, ! """Once a new item is received in the inbox, SpamBayes will begin ! processing messages after the given delay. If a new message arrives ! during this period, the timer will be reset and delay will start again.""", ! INTEGER, RESTORE), ! ("timer_interval", "The interval between subsequent timer checks (in ms)", 1000, ! """Once the new message timer finds a new message, how long should ! SpamBayes wait before checking for another new message, assuming no ! other new messages arrive. Should a new message arrive during this ! process, the timer will reset, meaning that timer_start_delay will ! elapse before the process begins again.""", ! INTEGER, RESTORE), ! ("timer_only_receive_folders", ! "Should the timer only be used for 'Inbox' type folders", True, ! """The point of using a timer is to prevent the SpamBayes filter ! getting in the way the builtin Outlook rules. Therefore, is it ! generally only necessary to use a timer for folders that have new ! items being delivered directly to them. Folders that are not inbox ! style folders generally are not subject to builtin filtering, so ! generally have no problems filtering messages in 'real time'.""", ! BOOLEAN, RESTORE), ), "Training" : ( --- 110,121 ---- # Experimental options may change, may get removed, and *will* get moved # should they be kept. + # Experimental options will *never* be exposed via the GUI, meaning that + # migrating any such options should be considered a favour :) "Experimental" : ( ! # These are migrated, so must remain while migration code remains in place. ! # This isn't critical, so should be deleted after just a few version. ! ("timer_start_delay", "obsolete", 0, "", INTEGER, RESTORE), ! ("timer_interval", "obsolete", 1000, "", INTEGER, RESTORE), ! ("timer_only_receive_folders", "obsolete", True, "", BOOLEAN, RESTORE), ), "Training" : ( *************** *** 231,234 **** --- 217,249 ---- """""", BOOLEAN, RESTORE), + # Options that allow the filtering to be done by a timer. + ("timer_enabled", "Should items be filtered by a timer?", False, + """Depending on a number of factors, SpamBayes may occasionally miss + messages or conflict with builtin Outlook rules. If this option + is set, SpamBayes will filter all messages in the background. This + generally solves both of these problem, at the cost of having Spam stay + in your inbox for a few extra seconds.""", + BOOLEAN, RESTORE), + ("timer_start_delay", "The interval (in seconds) before the timer starts.", 2.0, + """Once a new item is received in the inbox, SpamBayes will begin + processing messages after the given delay. If a new message arrives + during this period, the timer will be reset and the delay will start again.""", + REAL, RESTORE), + ("timer_interval", "The interval between subsequent timer checks (in seconds)", 1.0, + """Once the new message timer finds a new message, how long should + SpamBayes wait before checking for another new message, assuming no + other new messages arrive. Should a new message arrive during this + process, the timer will reset, meaning that timer_start_delay will + elapse before the process begins again.""", + REAL, RESTORE), + ("timer_only_receive_folders", + "Should the timer only be used for 'Inbox' type folders?", True, + """The point of using a timer is to prevent the SpamBayes filter + getting in the way the builtin Outlook rules. Therefore, is it + generally only necessary to use a timer for folders that have new + items being delivered directly to them. Folders that are not inbox + style folders generally are not subject to builtin filtering, so + generally have no problems filtering messages in 'real time'.""", + BOOLEAN, RESTORE), ), "Filter_Now": ( *************** *** 287,290 **** --- 302,326 ---- options.load_defaults(defaults) return options + + def MigrateOptions(options): + # Migrate some "old" options to "new" options. Can be deleted in + # a few versions :) + # Binary007 last with experimental timer values. + delay = options.get("Experimental", "timer_start_delay") + interval = options.get("Experimental", "timer_interval") + if delay and interval: + options.set("Filter", "timer_enabled", True) + options.set("Filter", "timer_start_delay", float(delay / 1000)) + options.set("Filter", "timer_interval", float(interval / 1000)) + # and reset the old options so they are not written to the new file + # (actually, resetting isn't enough - must hack and clobber) + del options._options["Experimental", "timer_start_delay"] + del options._options["Experimental", "timer_interval"] + + torf = options.get("Experimental", "timer_only_receive_folders") + if not torf: + options.set("Filter", "timer_only_receive_folders", False) + # and reset old + del options._options["Experimental", "timer_only_receive_folders"] # Old code when we used a pickle. Still needed so old pickles can be Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** manager.py 25 Aug 2003 14:29:33 -0000 1.80 --- manager.py 26 Aug 2003 02:35:45 -0000 1.81 *************** *** 646,650 **** --- 646,655 ---- self.LogDebug(self.verbose, "System verbosity set to", self.verbose) + # Do any migrations - first the old pickle into the new format. self.MigrateOldPickle() + # Then any options we change (particularly any 'experimental' ones we + # consider important) + import config + config.MigrateOptions(self.options) if self.verbose > 1: From mhammond at users.sourceforge.net Mon Aug 25 20:53:11 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 22:53:15 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs opt_processors.py, 1.10, 1.11 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv22985 Modified Files: opt_processors.py Log Message: Boolean processor takes an optional list of control IDs to disable if the option is False. Index: opt_processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/opt_processors.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** opt_processors.py 26 Aug 2003 02:26:13 -0000 1.10 --- opt_processors.py 26 Aug 2003 02:53:09 -0000 1.11 *************** *** 72,79 **** --- 72,86 ---- # where we must "uncheck" the other button. class BoolButtonProcessor(OptionControlProcessor): + def __init__(self, window, control_ids, option, disable_when_false_ids=""): + OptionControlProcessor.__init__(self, window, control_ids, option) + self.disable_ids = [window.manager.dialog_parser.ids[id] + for id in disable_when_false_ids.split()] def OnCommand(self, wparam, lparam): code = win32api.HIWORD(wparam) if code == win32con.BN_CLICKED: self.UpdateValue_FromControl() + def UpdateEnabledStates(self, enabled): + for other in self.disable_ids: + win32gui.EnableWindow(self.GetControl(other), enabled) def UpdateControl_FromValue(self): value = self.GetOptionValue() *************** *** 81,88 **** --- 88,97 ---- for other in self.other_ids: win32gui.SendMessage(self.GetControl(other), win32con.BM_SETCHECK, not value) + self.UpdateEnabledStates(value) def UpdateValue_FromControl(self): check = win32gui.SendMessage(self.GetControl(), win32con.BM_GETCHECK) check = not not check # force bool! self.SetOptionValue(check) + self.UpdateEnabledStates(check) class RadioButtonProcessor(OptionControlProcessor): From mhammond at users.sourceforge.net Mon Aug 25 20:53:41 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 22:53:45 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.25, 1.26 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv23127 Modified Files: dialog_map.py Log Message: timer_enabled button. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** dialog_map.py 26 Aug 2003 02:35:45 -0000 1.25 --- dialog_map.py 26 Aug 2003 02:53:39 -0000 1.26 *************** *** 409,412 **** --- 409,416 ---- ), "IDD_ADVANCED" : ( + (BoolButtonProcessor, "IDC_BUT_TIMER_ENABLED", "Filter.timer_enabled", + """IDC_DELAY1_TEXT IDC_DELAY1_SLIDER + IDC_DELAY2_TEXT IDC_DELAY2_SLIDER + IDC_INBOX_TIMER_ONLY"""), (EditNumberProcessor, "IDC_DELAY1_TEXT IDC_DELAY1_SLIDER", "Filter.timer_start_delay", 0, 10, 20), (EditNumberProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Filter.timer_interval", 0, 10, 20), From mhammond at users.sourceforge.net Mon Aug 25 20:53:42 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 22:53:54 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.h, 1.15, 1.16 dialogs.rc, 1.24, 1.25 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv23127/resources Modified Files: dialogs.h dialogs.rc Log Message: timer_enabled button. Index: dialogs.h =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dialogs.h 25 Aug 2003 17:28:09 -0000 1.15 --- dialogs.h 26 Aug 2003 02:53:39 -0000 1.16 *************** *** 101,104 **** --- 101,106 ---- #define IDC_BUT_UNTRAINED 1088 #define IDC_BUT_TRAIN 1089 + #define IDC_CHECK1 1090 + #define IDC_BUT_TIMER_ENABLED 1091 // Next default values for new objects *************** *** 108,112 **** #define _APS_NEXT_RESOURCE_VALUE 124 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1090 #define _APS_NEXT_SYMED_VALUE 101 #endif --- 110,114 ---- #define _APS_NEXT_RESOURCE_VALUE 124 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1092 #define _APS_NEXT_SYMED_VALUE 101 #endif Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** dialogs.rc 25 Aug 2003 17:05:35 -0000 1.24 --- dialogs.rc 26 Aug 2003 02:53:39 -0000 1.25 *************** *** 34,53 **** FONT 8, "Tahoma", 400, 0, 0x0 BEGIN ! GROUPBOX "Filter timer",IDC_STATIC,7,0,234,104 CONTROL "",IDC_DELAY1_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | ! TBS_TOP | WS_TABSTOP,16,18,148,22 ! LTEXT "Processing start delay",IDC_STATIC,14,9,101,8 ! EDITTEXT IDC_DELAY1_TEXT,165,25,40,14,ES_AUTOHSCROLL ! LTEXT "seconds",IDC_STATIC,208,27,28,8 CONTROL "",IDC_DELAY2_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | ! TBS_TOP | WS_TABSTOP,16,60,148,22 ! LTEXT "Delay between new mail check",IDC_STATIC,14,47,101,8 ! EDITTEXT IDC_DELAY2_TEXT,165,69,40,14,ES_AUTOHSCROLL ! LTEXT "seconds",IDC_STATIC,207,69,28,8 ! CONTROL "Timer only applies to Inbox",IDC_INBOX_TIMER_ONLY, ! "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,89,104,10 ! LTEXT "I'm not here. Don't Right Click me.",IDC_HIDDEN,165,118, 69,46 ! PUSHBUTTON "Show Data Folder",IDC_SHOW_DATA_FOLDER,7,108,60,14 END --- 34,56 ---- FONT 8, "Tahoma", 400, 0, 0x0 BEGIN ! GROUPBOX "Filter timer",IDC_STATIC,7,3,234,117 CONTROL "",IDC_DELAY1_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | ! TBS_TOP | WS_TABSTOP,16,36,148,22 ! LTEXT "Processing start delay",IDC_STATIC,16,26,101,8 ! EDITTEXT IDC_DELAY1_TEXT,165,39,40,14,ES_AUTOHSCROLL ! LTEXT "seconds",IDC_STATIC,208,41,28,8 CONTROL "",IDC_DELAY2_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | ! TBS_TOP | WS_TABSTOP,16,73,148,22 ! LTEXT "Delay between new mail check",IDC_STATIC,16,62,101,8 ! EDITTEXT IDC_DELAY2_TEXT,165,79,40,14,ES_AUTOHSCROLL ! LTEXT "seconds",IDC_STATIC,207,82,28,8 ! CONTROL "Only for folders that receive new mail", ! IDC_INBOX_TIMER_ONLY,"Button",BS_AUTOCHECKBOX | ! WS_TABSTOP,16,100,217,10 ! LTEXT "I'm not here. Don't Right Click me.",IDC_HIDDEN,172,128, 69,46 ! PUSHBUTTON "Show Data Folder",IDC_SHOW_DATA_FOLDER,16,127,60,14 ! CONTROL "Enable background filtering?",IDC_BUT_TIMER_ENABLED, ! "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,12,162,10 END *************** *** 344,347 **** --- 347,351 ---- LEFTMARGIN, 7 RIGHTMARGIN, 241 + VERTGUIDE, 16 BOTTOMMARGIN, 174 END From mhammond at users.sourceforge.net Mon Aug 25 21:07:18 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Aug 25 23:07:26 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.25, 1.26 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv25137 Modified Files: dialogs.rc Log Message: Group the "ham training" options with the "spam training" ones Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** dialogs.rc 26 Aug 2003 02:53:39 -0000 1.25 --- dialogs.rc 26 Aug 2003 03:07:16 -0000 1.26 *************** *** 505,509 **** FONT 8, "Tahoma", 0, 0, 0x1 BEGIN ! GROUPBOX "Bulk training",IDC_STATIC,5,1,243,113 LTEXT "Folders with known good messages.",IDC_STATIC,11,11,131, 11 --- 505,509 ---- FONT 8, "Tahoma", 0, 0, 0x1 BEGIN ! GROUPBOX "",IDC_STATIC,5,1,243,113 LTEXT "Folders with known good messages.",IDC_STATIC,11,11,131, 11 *************** *** 529,542 **** IDC_BUT_TRAIN_FROM_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,127,204,18 ! LTEXT "Clicking Delete as Spam should",IDC_STATIC,11,148,104, ! 10 ! COMBOBOX IDC_DEL_SPAM_RS,130,145,112,54,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "Train that a message is spam when it is moved to the spam folder", IDC_BUT_TRAIN_TO_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,163,204,16 ! LTEXT "Clicking Recover From Spam should",IDC_STATIC,11,183, ! 115,10 ! COMBOBOX IDC_RECOVER_RS,128,180,114,54,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END --- 529,542 ---- IDC_BUT_TRAIN_FROM_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,127,204,18 ! LTEXT "Clicking Recover From Spam should",IDC_STATIC,10,148, ! 115,10 ! COMBOBOX IDC_RECOVER_RS,127,145,114,54,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "Train that a message is spam when it is moved to the spam folder", IDC_BUT_TRAIN_TO_SPAM_FOLDER,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,163,204,16 ! LTEXT "Clicking Delete as Spam should",IDC_STATIC,10,183,104, ! 10 ! COMBOBOX IDC_DEL_SPAM_RS,129,180,112,54,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END From anadelonbrin at users.sourceforge.net Mon Aug 25 22:30:43 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 26 00:30:49 2003 Subject: [Spambayes-checkins] spambayes/spambayes/resources ui.html, 1.16, 1.17 ui_html.py, 1.17, 1.18 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes/resources In directory sc8-pr-cvs1:/tmp/cvs-serv2659/spambayes/resources Modified Files: ui.html ui_html.py Log Message: Implement #791254 Advanceconfiguration panel Add an advanced configuration page to the pop3proxy and imapfilter web interfaces. Also fix the restoring of defaults, which had been broken for quite a long time. Index: ui.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui.html,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ui.html 18 Aug 2003 00:53:12 -0000 1.16 --- ui.html 26 Aug 2003 04:30:41 -0000 1.17 *************** *** 383,389 ****
    !
    --- 383,395 ----
    !
    + +
    +
    + +
    +
    Index: ui_html.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui_html.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ui_html.py 18 Aug 2003 00:53:12 -0000 1.17 --- ui_html.py 26 Aug 2003 04:30:41 -0000 1.18 *************** *** 6,86 **** import zlib ! data = zlib.decompress("x[}s63\016(o\022sDI%N\023ۭ\016\0072\ ! \032>\015\027\023ky\017;ڴ^y%(\030\035>h\006\036\0272\016}$\036h^\024niJ,\ ! xpe0S\011e<\014t5{]=\022h\034>\013V,d\036\0314e\037l\021\003͡~\013Y\ ! 2u%Qщ!⹈.ɋֲ\033)\037D\024\005_\011_%\012ïxl+9;\032[\000f\017\ ! _{=Da\006=x\036\034\003َ\014%\027\000\037@\025{hk遤==\007{\001P.\ ! z;7\032i\0331\\GGϖ~\000Ut\011NrHo\0275ئc\ ! *ck+\011\021-~q\035\012~\032F,yQ\\e@[\014\034\034\000\000QbE\036\\f.\003J\ ! g._\024I\024ptQd\007PhQ\023]0\023'r\031VA#OZ\021/ba\007\004ub(\037E=\003B\ ! \000\005\0339>\001\035zW'\013fhB\032Vec\030\031`6>)PC\016ZxEg\ ! 1`(/C\"ӣF\010g0\026A\020(C\037\001\022\020 0P\037LCUx(yY\025\012oꁯ<\ ! \027\030\"_n@OQ/\032V\001k-\021\0040H2K`\005\037dQ\016c )О\016\030\001Ӂ\024Nj\ ! (֌\001knTWVQ\005t\020+\013\022B]Xe1G\\\"#\006/\025f\027\013|w\\C-\ ! U2Ws|vt~8s*jM\016m\005\033T&9D:[=>^0jD'\001\031M\027~g\ ! \025↜\037\035\035yZ\036?\0273m\"e󚂎\"'\026y#yy\013Jy/\024`\011Hv\ ! tŞӠ\033\001\024z:3Aօ\032mŔ\\#r4\ ! 7N\031cq{\024\000\012V\\\020`\035\017\"R夆1y\031r\000\013\014\ ! !o̎v!YlR$5P(\013%\0065K %QoglZAzZUȚ\003l\003\027\022dh$\ ! 8o\000ۣrQ\033]q`W\031B3mdJL\035k\005\013\\heѐP#k5bR5}QF$\ ! :6툔BQhXIu ց\004K-\020PUMC\033+\033R\005Bj\010gk\021x\006„,\002sE\ ! U %\000k%\000\"~P\025\0250w]\001b\0021\\,EBuyG\013F\015H\006ګ1\035&^\ ! h(Ԡ\010x\0361#\011n\004~\0220S\004\001jZI\007G} ldJ2\035\024pR1\001\002\ ! \000\027sg\022\001M:\012C;\014Ko3\027(A\014\010WP/\020HAxmp#\032~@[\013n>b\ ! \020HZ$Qi8XIw$DwЍ?+ 〇è@đUAm\036w\002L\016\014|\034\007׺\ ! o\017ۢ4u\020sL\016o9t;\ ! CnE\022ގ߷k1\000)\036p4ep\025c_\037w\016\0139Xu(XG]Fi\010\026ۜ\ ! |\013\022Y*\016R\001յ\031GEID\012ی*# ӛ\0006۫CKH\010-q3!#\ ! ߋ\003(\032*m6fW?`\002i9={Y\024؆\024ev\001|n'}%ўQ'\ ! ͘Y\015\005@ryz7pI}Je@i\007\013=鷑ΌDy_4\ ! eŒ\006%ڜ:Z\012L\000L%U\\F\031K0%7\"\023\015EqY\021U\011\ ! 7\000\022*j\000}&F껖$\010ڈ9\012\011\0362\023N\000)h\033pO.\010#L\ ! JJr\000D\027\\<^}=٭Cbʒa\015^\017\010UnlS[&˭\032|\ ! ې3X\036\024k\025Q\020/$\"!gt\006Qq*AE]{h\017X.\022yO2\ ! \001;WT\036 1Ja;\033SWWn_\030IF!Uǩ݅Ͷ\001\005}Ǜ>\ ! C8$gW\004z\016nY\003ݷ5|Dcn[NyӃE\037\ ! Z\031<}\034sRѽ\012B_j}WZ\004\033`!@a\037d(\000WBPm}d\000\021R5)NdN\ ! }vu+^;Xʎ3eψI]o߽\014\037x\017\034pϯQ\020\033HZ\006\ ! \016قcWJ:\012]3\032\035=~\033K\022<[ 줮@\035qC\016v*'\007̛܂˽M ic\ ! d)k\021gA:<]}\023ĥJgQ\000.a\020\0055f\000zp\026WO\035+6Μ\ ! \036uJsYm/t\013\036sK\033}\012E[?S^`*o7k\027qW\ ! u6s\022d`iW\037\037:D\\\032ק\022MZ|~9ڵ^Kx+\ ! ҕK\031`8/m\036mbڻ'M_JwfE\021+68<_k\ ! \025c}\020[Rݩ&b%bJnU*e'%5\026top\032_5/\020\0365-\013;Ē\023!\ ! ->ֵ\000-\006?޺*C\016%^I37\035a%b)\022\010xM\ ! z-edY\027 ~^\013\ ! _i\034EٲO\017Тf&һ`'jO\0272B\003O[\036ob:\004 y/\005,\020'e[\001\0201\001]#t\012\032\ ! ®4O#9{Xb\020F\023]^~eh\000dlp\032gy\034.\036S\\@x\ ! \007%=6\002olL3\006\\\034a5*\004۶.xrlZ=Z%\037Y\012_\015q9\ ! vvAz:\000:uO=\034Wc#?\0139L\002:\007zY(ga;Cg3&sy\006\014\003\025\007G\ ! ƣ\035)E2\004B\015\003#\004*+Q!]\005\012\022\0335k7~oN\ ! Q\006\011LgIG&r\"I`dI`*SB-9h:k\037\007\020CԌ_\ ! E`E@GяA\021`^\037-Bȣ\016}\014@}\000\015\003Ai:,\025WUM3E\033ȗ\ ! ӉO,\032V\011Z|9#(,C'\034\025\032J\033I4tK\016\007`u҄b\030v\ ! oGuuju\017\035\006cE\000~+EUąXdd!n B]1k6Q\030w\003\0354WPKmnu\ ! \002=\037m\ ! A?feUΰ^v\027@y0W\006N\014ӧJIg\016M=mȦ;1q;\020g\"]Sy%}\ ! \003\030\027iR\000(*^?\006ͶBe#PldCltPKǰ\006P\012\010ྻX\ ! 8aJ\00468 aXz E\011b|\011\037x\010\014\024^\006xĄ\037\0127s?bv\"\026\ ! \007eLce9XK7$DЍ?K \020\017Gq\001#\012{4$\005\034\030)\016L<\037\ ! J}E\000=?w\017!t7\027i+m\",.\013-ox<׋?ʴ%\ ! Lc\0363H\027ҔR>5+\027ɰJ!\037!\037%{ߌ\022!{~3S[deП~9\ ! uc{1t\014NY̦4L\000/vO*!g;\020?ǿpG԰O\033\\h=Үh6c'\ ! ޺\001ŗ(5x?&vNSԙ\035)Nމ\014~\011\022\001zE%\006+|5\037/\ ! 4\021)ˎhxzϻou\002\024񮫥\027\002{\014O'\024KRf\034\ ! m!f'\035٘9͘lF2\000+z[r*9\"\002\022\031L'1\010\000\\v| \ ! c먑&Z7P\002'Lt7PA'NdKLKr>X\001ik\034uwM\035\036SÛe\017\034\015\027rFyͯp\023\0136\"(,\026\000\ ! \020eor \025P]]\\*\"RWΩ2;\0012&\011jS:T/t)x\024KA%n'd{\ ! Ӱ\003EV#Ͷy\036L\031x?.\013\002!\005\023 a2$\ ! ̤(*\0358\023}^0x\025tgw\016hK\032҇\015x[\0370TvMOo>J1ΧI\ ! \0159ua\017K1fIx]a\035\005#S$ζFiT\\>tJPq\036\003VTҥf\ ! \025;HRb;l\007usc\012\037\020<+)(q8?\011\0266\010A_\020\ ! \015ծ ^0z\016n1}x\034֘=\026J%8Ov\0275@\011^+2Z\ ! lC\037t\011\000\007hu!SƶPVx\003うaJЋ\036 tY%_ƐhnuժP\ ! wH0x\014Z 2\016O_\\\025_\022<\003btr*T˛\005x\031}̒1\ ! }\020E8C`P?`kiN\027\017X\022\024Z`Ki\000KVC>pMAE?\ ! 8IE+x\013s\011_-j\032\022Po\023L\014\005\024aJ>\022*ݾ^*>\002~ӭ~\ ! Nu\037O{\006Ao{?|\027q\027ţ\023o\003:W퇫\026\001\021R\0245)NdA\ ! }MK6|lNeǹy2'v\\.o]8}\017\007\016\027W(\015`$G\004\036\ ! قVJ:\012]3H;7f$\026y\036\011e'}\005g\035ڍ99ļ\015@M\012N;\ ! NF\021I\016\0356\005\007\011\014:^_,\0120\032S\000jpΖW\017\035'6Ξ\ ! \036\001L:¬7q\010K\"*݂УF\037B0,Tu?ʛt\013t븫[\ ! \032~H:\033}V\025\005y\011r24K&^\006\035\"F.\015iD\023\026~O/@ﵤ߉w\002\ ! \034]\031軒\011`}'i;~{\014a&yĨYCX3u-Xͦ\0363 \010V\ ! 1&\017uK;DDLݍN]\0025\025^\023t\013\014VT\010\035w\025\000\0271\ ! =\0314W#\036\006\035=xt˳PDZ>\015,V=q\002<|_kCnh6\ ! \0172++xRˆRz}3\003k=r1\022نM@Jp[\033(Ay\ ! \001 Y\015gCxS\020\033\0159V[8\013\013FA}+lYVEf_ɊJ_\036\033+rt\016\ ! bȭ\025D=L|.Bv\022\027\035\007ad̩T>\031F\021\013\035F[n5\ ! b\021Z Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv2659/spambayes Modified Files: ImapUI.py Options.py ProxyUI.py UserInterface.py Log Message: Implement #791254 Advanceconfiguration panel Add an advanced configuration page to the pop3proxy and imapfilter web interfaces. Also fix the restoring of defaults, which had been broken for quite a long time. Index: ImapUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ImapUI.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ImapUI.py 19 Aug 2003 08:52:04 -0000 1.16 --- ImapUI.py 26 Aug 2003 04:30:41 -0000 1.17 *************** *** 70,78 **** ('pop3proxy', 'notate_to'), ('pop3proxy', 'notate_subject'), - ('Headers', 'include_score'), - ('Headers', 'include_thermostat'), - ('Headers', 'include_evidence'), - ('pop3proxy', 'add_mailid_to'), - ('pop3proxy', 'strip_incoming_mailids'), ('Storage Options', None), ('Storage', 'persistent_storage_file'), --- 70,73 ---- *************** *** 81,85 **** ('Categorization', 'ham_cutoff'), ('Categorization', 'spam_cutoff'), ! ('Classifier', 'experimental_ham_spam_imbalance_adjustment'), ) --- 76,106 ---- ('Categorization', 'ham_cutoff'), ('Categorization', 'spam_cutoff'), ! ) ! ! # Like the above, but hese are the options that will be offered on the ! # advanced configuration page. ! adv_map = ( ! ('Statistics Options', None), ! ('Classifier', 'experimental_ham_spam_imbalance_adjustment'), ! ('Classifier', 'max_discriminators'), ! ('Classifier', 'minimum_prob_strength'), ! ('Classifier', 'unknown_word_prob'), ! ('Classifier', 'unknown_word_strength'), ! ('Header Options', None), ! ('Headers', 'include_score'), ! ('Headers', 'header_score_digits'), ! ('Headers', 'header_score_logarithm'), ! ('Headers', 'include_thermostat'), ! ('Headers', 'include_evidence'), ! ('Headers', 'clue_mailheader_cutoff'), ! ('Storage Options', None), ! ('Storage', 'persistent_use_database'), ! ('Tokenising Options', None), ! ('Tokenizer', 'extract_dow'), ! ('Tokenizer', 'generate_time_buckets'), ! ('Tokenizer', 'mine_received_headers'), ! ('Tokenizer', 'replace_nonascii_chars'), ! ('Tokenizer', 'summarize_email_prefixes'), ! ('Tokenizer', 'summarize_email_suffixes'), ) *************** *** 95,99 **** parm_list.remove(("imap", "use_ssl")) parm_map = tuple(parm_list) ! UserInterface.UserInterface.__init__(self, cls, parm_map) classifier = cls self.imap = imap --- 116,120 ---- parm_list.remove(("imap", "use_ssl")) parm_map = tuple(parm_list) ! UserInterface.UserInterface.__init__(self, cls, parm_map, adv_map) classifier = cls self.imap = imap Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Options.py 26 Aug 2003 01:52:25 -0000 1.65 --- Options.py 26 Aug 2003 04:30:41 -0000 1.66 *************** *** 150,156 **** ("mine_received_headers", "Mine the received headers", False, """A lot of clues can be gotten from IP addresses and names in ! Received: headers. Again this can give spectacular results for bogus ! reasons if your test corpora are from different sources. Else set this ! to true.""", BOOLEAN, RESTORE), --- 150,155 ---- ("mine_received_headers", "Mine the received headers", False, """A lot of clues can be gotten from IP addresses and names in ! Received: headers. This can give spectacular results for bogus ! reasons if your corpora are from different sources.""", BOOLEAN, RESTORE), *************** *** 194,198 **** BOOLEAN, RESTORE), ! ("replace_nonascii_chars", "", False, """If true, replace high-bit characters (ord(c) >= 128) and control characters with question marks. This allows non-ASCII character --- 193,197 ---- BOOLEAN, RESTORE), ! ("replace_nonascii_chars", "Replace non-ascii characters", False, """If true, replace high-bit characters (ord(c) >= 128) and control characters with question marks. This allows non-ASCII character *************** *** 393,399 **** "Classifier": ( ("max_discriminators", "Maximum number of extreme words", 150, ! """The maximum number of extreme words to look at in a msg, where ! "extreme" means with spamprob farthest away from 0.5. 150 appears to ! work well across all corpora tested.""", INTEGER, RESTORE), --- 392,398 ---- "Classifier": ( ("max_discriminators", "Maximum number of extreme words", 150, ! """The maximum number of extreme words to look at in a message, where ! "extreme" means with spam probability farthest away from 0.5. 150 ! appears to work well across all corpora tested.""", INTEGER, RESTORE), *************** *** 403,417 **** has never been seen before. Nobody has reported an improvement via moving it away from 1/2, although Tim has measured a mean spamprob of ! a bit over 0.5 (0.51-0.55) in 3 well-trained classifiers. ! uknown_word_strength adjusts how much weight to give the prior assumption relative to the probabilities estimated by counting. At 0, the counting estimates are believed 100%, even to the extent of assigning certainty (0 or 1) to a word that has appeared in only ham ! or only spam. This is a disaster.""", ! REAL, RESTORE), ! ! ("unknown_word_strength", "Unknown word strength", 0.45, ! """As unknown_word_strength tends toward infintity, all probabilities tend toward unknown_word_prob. All reports were that a value near 0.4 worked best, so this does not seem to be corpus-dependent.""", --- 402,416 ---- has never been seen before. Nobody has reported an improvement via moving it away from 1/2, although Tim has measured a mean spamprob of ! a bit over 0.5 (0.51-0.55) in 3 well-trained classifiers.""", ! REAL, RESTORE), ! ("unknown_word_strength", "Unknown word strength", 0.45, ! """This adjusts how much weight to give the prior assumption relative to the probabilities estimated by counting. At 0, the counting estimates are believed 100%, even to the extent of assigning certainty (0 or 1) to a word that has appeared in only ham ! or only spam. This is a disaster. ! ! As unknown_word_strength tends toward infintity, all probabilities tend toward unknown_word_prob. All reports were that a value near 0.4 worked best, so this does not seem to be corpus-dependent.""", *************** *** 468,472 **** ("experimental_ham_spam_imbalance_adjustment", "Compensate for unequal numbers of spam and ham", False, ! """If your training database has significantly (3 times) more ham than spam, or vice versa, you may start seeing an increase in incorrect classifications (messages put in the wrong category, not just marked --- 467,471 ---- ("experimental_ham_spam_imbalance_adjustment", "Compensate for unequal numbers of spam and ham", False, ! """If your training database has significantly more ham than spam, or vice versa, you may start seeing an increase in incorrect classifications (messages put in the wrong category, not just marked *************** *** 508,515 **** # loaded by the appropriate application only. "Storage" : ( ! ("persistent_use_database", "", True, ! """hammiefilter can use either a database (quick to score one message) or a pickle (quick to train on huge amounts of messages). Set this to ! True to use a database by default.""", BOOLEAN, RESTORE), --- 507,514 ---- # loaded by the appropriate application only. "Storage" : ( ! ("persistent_use_database", "Use database for storage", True, ! """SpamBayes can use either a database (quick to score one message) or a pickle (quick to train on huge amounts of messages). Set this to ! use a database by default.""", BOOLEAN, RESTORE), *************** *** 579,583 **** ("header_score_logarithm", "Augment score with logarithm", False, ! """Set this to "True", to augment scores of 1.00 or 0.00 by a logarithmic "one-ness" or "zero-ness" score (basically it shows the "number of zeros" or "number of nines" next to the score value).""", --- 578,582 ---- ("header_score_logarithm", "Augment score with logarithm", False, ! """Set this option to augment scores of 1.00 or 0.00 by a logarithmic "one-ness" or "zero-ness" score (basically it shows the "number of zeros" or "number of nines" next to the score value).""", *************** *** 674,694 **** ("cache_use_gzip", "Use gzip", False, ! """""", BOOLEAN, RESTORE), ("cache_expiry_days", "Days before cached messages expire", 7, ! """""", INTEGER, RESTORE), ("spam_cache", "Spam cache directory", "pop3proxy-spam-cache", ! """""", PATH, DO_NOT_RESTORE), ("ham_cache", "Ham cache directory", "pop3proxy-ham-cache", ! """""", PATH, DO_NOT_RESTORE), ("unknown_cache", "Unknown cache directory", "pop3proxy-unknown-cache", ! """""", PATH, DO_NOT_RESTORE), --- 673,699 ---- ("cache_use_gzip", "Use gzip", False, ! """Use gzip to compress the cache.""", BOOLEAN, RESTORE), ("cache_expiry_days", "Days before cached messages expire", 7, ! """Messages will be expired from the cache after this many days. ! After this time, you will no longer be able to train on these messages ! (note this does not effect the copy of the message that you have in ! your mail client).""", INTEGER, RESTORE), ("spam_cache", "Spam cache directory", "pop3proxy-spam-cache", ! """Directory that SpamBayes should cache spam in. If this does ! not exist, it will be created.""", PATH, DO_NOT_RESTORE), ("ham_cache", "Ham cache directory", "pop3proxy-ham-cache", ! """Directory that SpamBayes should cache ham in. If this does ! not exist, it will be created.""", PATH, DO_NOT_RESTORE), ("unknown_cache", "Unknown cache directory", "pop3proxy-unknown-cache", ! """Directory that SpamBayes should cache unclassified messages in. ! If this does not exist, it will be created.""", PATH, DO_NOT_RESTORE), Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ProxyUI.py 26 Aug 2003 00:24:16 -0000 1.18 --- ProxyUI.py 26 Aug 2003 04:30:41 -0000 1.19 *************** *** 83,89 **** ('pop3proxy', 'remote_servers'), ('pop3proxy', 'listen_ports'), - ('pop3proxy', 'cache_messages'), - ('pop3proxy', 'no_cache_bulk_ham'), - ('pop3proxy', 'no_cache_large_messages'), ('html_ui', 'display_to'), ('html_ui', 'allow_remote_connections'), --- 83,86 ---- *************** *** 91,97 **** ('pop3proxy', 'notate_to'), ('pop3proxy', 'notate_subject'), - ('Headers', 'include_score'), - ('Headers', 'include_thermostat'), - ('Headers', 'include_evidence'), ('SMTP Proxy Options', None), ('smtpproxy', 'remote_servers'), --- 88,91 ---- *************** *** 99,109 **** --- 93,138 ---- ('smtpproxy', 'ham_address'), ('smtpproxy', 'spam_address'), + ('smtpproxy', 'use_cached_message'), ('Storage Options', None), ('Storage', 'persistent_storage_file'), ('Storage', 'messageinfo_storage_file'), + ('pop3proxy', 'cache_messages'), + ('pop3proxy', 'no_cache_bulk_ham'), + ('pop3proxy', 'no_cache_large_messages'), ('Statistics Options', None), ('Categorization', 'ham_cutoff'), ('Categorization', 'spam_cutoff'), + ) + + # Like the above, but hese are the options that will be offered on the + # advanced configuration page. + adv_map = ( + ('Statistics Options', None), ('Classifier', 'experimental_ham_spam_imbalance_adjustment'), + ('Classifier', 'max_discriminators'), + ('Classifier', 'minimum_prob_strength'), + ('Classifier', 'unknown_word_prob'), + ('Classifier', 'unknown_word_strength'), + ('Header Options', None), + ('Headers', 'include_score'), + ('Headers', 'header_score_digits'), + ('Headers', 'header_score_logarithm'), + ('Headers', 'include_thermostat'), + ('Headers', 'include_evidence'), + ('Headers', 'clue_mailheader_cutoff'), + ('Storage Options', None), + ('Storage', 'persistent_use_database'), + ('pop3proxy', 'cache_expiry_days'), + ('pop3proxy', 'cache_use_gzip'), + ('pop3proxy', 'ham_cache'), + ('pop3proxy', 'spam_cache'), + ('pop3proxy', 'unknown_cache'), + ('Tokenising Options', None), + ('Tokenizer', 'extract_dow'), + ('Tokenizer', 'generate_time_buckets'), + ('Tokenizer', 'mine_received_headers'), + ('Tokenizer', 'replace_nonascii_chars'), + ('Tokenizer', 'summarize_email_prefixes'), + ('Tokenizer', 'summarize_email_suffixes'), ) *************** *** 114,118 **** global state UserInterface.UserInterface.__init__(self, proxy_state.bayes, ! parm_ini_map) state = proxy_state self.state_recreator = state_recreator # ugly --- 143,147 ---- global state UserInterface.UserInterface.__init__(self, proxy_state.bayes, ! parm_ini_map, adv_map) state = proxy_state self.state_recreator = state_recreator # ugly *************** *** 485,493 **** state = self.state_recreator() ! def verifyInput(self, parms): '''Check that the given input is valid.''' # Most of the work here is done by the parent class, but # we have a few extra checks ! errmsg = UserInterface.UserInterface.verifyInput(self, parms) # check for equal number of pop3servers and ports --- 514,525 ---- state = self.state_recreator() ! def verifyInput(self, parms, pmap): '''Check that the given input is valid.''' # Most of the work here is done by the parent class, but # we have a few extra checks ! errmsg = UserInterface.UserInterface.verifyInput(self, parms, pmap) ! ! if pmap == adv_map: ! return errmsg # check for equal number of pop3servers and ports Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** UserInterface.py 20 Aug 2003 08:33:25 -0000 1.17 --- UserInterface.py 26 Aug 2003 04:30:41 -0000 1.18 *************** *** 21,24 **** --- 21,25 ---- onSave - save the database and possibly shutdown onConfig - present the appropriate configuration page + onAdvancedconfig - present the appropriate advanced configuration page To Do: *************** *** 80,84 **** import Dibbler import tokenizer ! from Options import options, optionsPathname, defaults IMAGES = ('helmet', 'status', 'config', --- 81,85 ---- import Dibbler import tokenizer ! from Options import options, optionsPathname, defaults, OptionsClass IMAGES = ('helmet', 'status', 'config', *************** *** 226,230 **** """Serves the HTML user interface.""" ! def __init__(self, bayes, config_parms=()): """Load up the necessary resources: ui.html and helmet.gif.""" global classifier --- 227,231 ---- """Serves the HTML user interface.""" ! def __init__(self, bayes, config_parms=(), adv_parms=()): """Load up the necessary resources: ui.html and helmet.gif.""" global classifier *************** *** 232,235 **** --- 233,237 ---- classifier = bayes self.parm_ini_map = config_parms + self.advanced_options_map = adv_parms def onClassify(self, file, text, which): *************** *** 439,443 **** --- 441,463 ---- pass + def onAdvancedconfig(self): + html = self._buildConfigPage(self.advanced_options_map) + html.title = 'Home > Advanced Configuration' + html.pagename = '> Advanced Configuration' + html.adv_button.name.value = "Back to basic configuration" + html.adv_button.action = "config" + html.config_submit.value = "Save advanced options" + html.restore.value = "Restore advanced options defaults" + self.writeOKHeaders('text/html') + self.write(html) + def onConfig(self): + html = self._buildConfigPage(self.parm_ini_map) + html.title = 'Home > Configure' + html.pagename = '> Configure' + self.writeOKHeaders('text/html') + self.write(html) + + def _buildConfigPage(self, parm_map): # Start with an empty config form then add the sections. html = self._getHTMLClone() *************** *** 452,459 **** # Loop though the sections. ! for sect, opt in self.parm_ini_map: # We need a string to use as the html key that we can change to # and from the sect, opt pair. We like irony, so we use '_' as ! # the delimiter if opt is None: if configTable is not None and section is not None: --- 472,479 ---- # Loop though the sections. ! for sect, opt in parm_map: # We need a string to use as the html key that we can change to # and from the sect, opt pair. We like irony, so we use '_' as ! # the delimiter . if opt is None: if configTable is not None and section is not None: *************** *** 560,575 **** section.boxContent = configTable html.configFormContent += section ! html.title = 'Home > Configure' ! html.pagename = '> Configure' ! self.writeOKHeaders('text/html') ! self.write(html) def onChangeopts(self, **parms): if parms.has_key("how"): del parms["how"] html = self._getHTMLClone() html.shutdownTableCell = " " html.mainContent = self.html.headedBox.clone() ! errmsg = self.verifyInput(parms) if errmsg != '': --- 580,596 ---- section.boxContent = configTable html.configFormContent += section ! return html def onChangeopts(self, **parms): if parms.has_key("how"): + if parms["how"] == "Save advanced options": + pmap = self.advanced_options_map + else: + pmap = self.parm_ini_map del parms["how"] html = self._getHTMLClone() html.shutdownTableCell = " " html.mainContent = self.html.headedBox.clone() ! errmsg = self.verifyInput(parms, pmap) if errmsg != '': *************** *** 584,588 **** for name, value in parms.items(): sect, opt = name.split('_', 1) ! if (sect, opt) in self.parm_ini_map: options.set(sect, opt, value) # If a section name has an underscore in it (like html_ui) --- 605,609 ---- for name, value in parms.items(): sect, opt = name.split('_', 1) ! if (sect, opt) in pmap: options.set(sect, opt, value) # If a section name has an underscore in it (like html_ui) *************** *** 605,609 **** def onRestoredefaults(self, how): ! self.restoreConfigDefaults() self.reReadOptions() --- 626,633 ---- def onRestoredefaults(self, how): ! if how == "Restore advanced options defaults": ! self.restoreConfigDefaults(self.advanced_options_map) ! else: ! self.restoreConfigDefaults(self.parm_ini_map) self.reReadOptions() *************** *** 619,623 **** self.write(html) ! def verifyInput(self, parms): '''Check that the given input is valid.''' # Most of the work here is done by the options class, but --- 643,647 ---- self.write(html) ! def verifyInput(self, parms, pmap): '''Check that the given input is valid.''' # Most of the work here is done by the options class, but *************** *** 636,640 **** del parms[name] ! for sect, opt in self.parm_ini_map: if opt is None: nice_section_name = sect --- 660,664 ---- del parms[name] ! for sect, opt in pmap: if opt is None: nice_section_name = sect *************** *** 672,691 **** return errmsg ! def restoreConfigDefaults(self): ! # note that the behaviour of this function has subtly changed # previously options were removed from the config file, now the # config file is updated to match the defaults ! c = ConfigParser() ! d = StringIO(defaults) ! c.readfp(d) ! del d # Only restore the settings that appear on the form. ! for section, option in self.parm_ini_map: if option is not None: if not options.no_restore(section, option): ! options.set(section, option, c.get(section,option)) ! op = open(optionsPathname, "r") ! options.update_file(op) ! op.close() --- 696,711 ---- return errmsg ! def restoreConfigDefaults(self, parm_map): ! # note that the behaviour of this function has subtly changed: # previously options were removed from the config file, now the # config file is updated to match the defaults ! d = OptionsClass() ! d.load_defaults(defaults) # Only restore the settings that appear on the form. ! for section, option in parm_map: if option is not None: if not options.no_restore(section, option): ! options.set(section, option, d.get(section,option)) ! options.update_file(optionsPathname) From mhammond at users.sourceforge.net Mon Aug 25 22:52:08 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 00:52:17 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs wizard_processors.py, 1.8, 1.9 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv5063 Modified Files: wizard_processors.py Log Message: Fix a bug in the wizard that disabled the "Next" button if you changed a folder name in the edit control. Index: wizard_processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/wizard_processors.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wizard_processors.py 24 Aug 2003 13:21:13 -0000 1.8 --- wizard_processors.py 26 Aug 2003 04:52:06 -0000 1.9 *************** *** 252,257 **** if code==win32con.EN_CHANGE: if not self.in_setting_name: ! self.SetOptionValue(None) # reset the folder IDs. ! self.SetOptionValue("", self.option_folder_name) return opt_processors.FolderIDProcessor.OnCommand(self, wparam, lparam) --- 252,261 ---- if code==win32con.EN_CHANGE: if not self.in_setting_name: ! # reset the folder IDs. ! self.SetOptionValue(None) ! # Set the folder name ! hedit = win32gui.GetDlgItem(self.window.hwnd, id) ! text = win32gui.GetWindowText(hedit) ! self.SetOptionValue(text, self.option_folder_name) return opt_processors.FolderIDProcessor.OnCommand(self, wparam, lparam) From mhammond at users.sourceforge.net Tue Aug 26 00:01:48 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 02:02:24 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.66,1.67 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv14070 Modified Files: msgstore.py Log Message: YieldReceiveFolders() only returns folders that appear to be useful. GetFQName() uses the "information store" name as the root folder just like Outlook itself and the Folder selector. Index: msgstore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** msgstore.py 25 Aug 2003 04:21:06 -0000 1.66 --- msgstore.py 26 Aug 2003 06:01:46 -0000 1.67 *************** *** 367,371 **** hex_folder_eid = mapi.HexFromBin(folder_eid) hex_store_eid = mapi.HexFromBin(store_eid) ! yield self.GetFolder((hex_store_eid, hex_folder_eid)) except pythoncom.com_error, details: if not IsNotAvailableCOMException(details): --- 367,376 ---- hex_folder_eid = mapi.HexFromBin(folder_eid) hex_store_eid = mapi.HexFromBin(store_eid) ! folder = self.GetFolder((hex_store_eid, hex_folder_eid)) ! # For 'unconfigured' stores, or "stand-alone" PST files, ! # this is a root folder - so not what we wan't. Only return ! # folders with a parent. ! if folder.GetParent() is not None: ! yield folder except pythoncom.com_error, details: if not IsNotAvailableCOMException(details): *************** *** 449,452 **** --- 454,478 ---- parts.insert(0, parent.name) parent = parent.GetParent() + # We now end up with [0] being an empty string??, [1] being the + # information store root folder name, etc. Outlook etc all just + # use the information store name here. + if not parts[0]: + del parts[0] + # Replace the "root" folder name with the information store name + # as Outlook, our Folder selector etc do. + mapi_store = self.msgstore._GetMessageStore(self.id[0]) + hr, data = mapi_store.GetProps((PR_DISPLAY_NAME_A,), 0) + name = data[0][1] + if parts: + # and replace with new name + parts[0] = name + else: + # This can happen for the very root folder (ie, parent of the + # top-level folder shown by Outlook. This folder should *never* + # be used directly. + parts = [name] + print "WARNING: It appears you are using the top-level root of " \ + "the information store as a folder. You probably don't "\ + "want to do that" return "/".join(parts) From anadelonbrin at users.sourceforge.net Mon Aug 25 23:40:56 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 26 02:02:33 2003 Subject: [Spambayes-checkins] spambayes/spambayes Options.py,1.66,1.67 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv11694/spambayes Modified Files: Options.py Log Message: Typo in option 'nice' name. Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Options.py 26 Aug 2003 04:30:41 -0000 1.66 --- Options.py 26 Aug 2003 05:40:53 -0000 1.67 *************** *** 175,179 **** BOOLEAN, RESTORE), ! ("summarize_email_suffixes", "Summarise email prefixes", False, """Try to capitalize on mail sent to multiple similar addresses.""", BOOLEAN, RESTORE), --- 175,179 ---- BOOLEAN, RESTORE), ! ("summarize_email_suffixes", "Summarise email suffixes", False, """Try to capitalize on mail sent to multiple similar addresses.""", BOOLEAN, RESTORE), From mhammond at users.sourceforge.net Tue Aug 26 00:25:36 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 02:25:46 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs opt_processors.py, 1.11, 1.12 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv17619 Modified Files: opt_processors.py Log Message: Remove stray print. Index: opt_processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/opt_processors.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** opt_processors.py 26 Aug 2003 02:53:09 -0000 1.11 --- opt_processors.py 26 Aug 2003 06:25:33 -0000 1.12 *************** *** 235,239 **** # Convert it to our range. val *= float(self.ticks) / self.max_val - print "Edit setting sliter to tick pos", val val = int(val) except ValueError: --- 235,238 ---- From anadelonbrin at users.sourceforge.net Tue Aug 26 00:49:58 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 26 02:50:24 2003 Subject: [Spambayes-checkins] spambayes/spambayes message.py,1.33,1.34 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv21589/spambayes Modified Files: message.py Log Message: An old option was left in by mistake, so remove that. Wrong import in smtpproxy.py. Remove the debugging information from smtpproxy.py - I think that these are all resolved now, although there might be one more... Index: message.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** message.py 26 Aug 2003 00:47:16 -0000 1.33 --- message.py 26 Aug 2003 06:49:56 -0000 1.34 *************** *** 342,346 **** del self[options['Headers','mailid_header_name']] del self[options['Headers','classification_header_name'] + "-ID"] # test mode header - del self[options['Headers','prob_header_name']] del self[options['Headers','thermostat_header_name']] del self[options['Headers','evidence_header_name']] --- 342,345 ---- From anadelonbrin at users.sourceforge.net Tue Aug 26 00:49:58 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 26 02:50:32 2003 Subject: [Spambayes-checkins] spambayes smtpproxy.py,1.10,1.11 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv21589 Modified Files: smtpproxy.py Log Message: An old option was left in by mistake, so remove that. Wrong import in smtpproxy.py. Remove the debugging information from smtpproxy.py - I think that these are all resolved now, although there might be one more... Index: smtpproxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/smtpproxy.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** smtpproxy.py 26 Aug 2003 02:29:40 -0000 1.10 --- smtpproxy.py 26 Aug 2003 06:49:56 -0000 1.11 *************** *** 139,143 **** from spambayes import Dibbler from spambayes import storage ! from spambayes.message import message_from_string from spambayes.tokenizer import textparts from spambayes.tokenizer import try_to_repair_damaged_base64 --- 139,143 ---- from spambayes import Dibbler from spambayes import storage ! from spambayes.message import sbheadermessage_from_string from spambayes.tokenizer import textparts from spambayes.tokenizer import try_to_repair_damaged_base64 *************** *** 230,238 **** if cooked is not None: self.serverSocket.push(cooked + '\r\n') - if options["globals", "verbose"]: - # XXX debugging information - # XXX remove this once the problems are sorted out - print "pulled", self.request - print "pushed", cooked + '\r\n' self.command = self.args = self.request = '' --- 230,233 ---- From mhammond at users.sourceforge.net Tue Aug 26 01:23:09 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 03:23:30 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rcparser.py, 1.9, 1.10 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv27313 Modified Files: rcparser.py Log Message: Cleanup exception handling, and only print a warning about duplicate IDs that don't look like internal AppStudio ones. Index: rcparser.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/rcparser.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** rcparser.py 25 Aug 2003 17:28:09 -0000 1.9 --- rcparser.py 26 Aug 2003 07:23:04 -0000 1.10 *************** *** 131,135 **** self.parseH(h) h.close() ! except: print "No .h file. ignoring." f = open(rcFileName) --- 131,135 ---- self.parseH(h) h.close() ! except OSError: print "No .h file. ignoring." f = open(rcFileName) *************** *** 158,162 **** self.ids[n] = i if self.names.has_key(i): ! print "Duplicate id",i,"for",n,"is", self.names[i] else: self.names[i] = n --- 158,164 ---- self.ids[n] = i if self.names.has_key(i): ! # ignore AppStudio special ones. ! if not n.startswith("_APS_"): ! print "Duplicate id",i,"for",n,"is", self.names[i] else: self.names[i] = n *************** *** 355,363 **** rcp.loadDialogs(rc_file) except: ! print "ERROR parsing dialogs at line", rcp.lex.lineno ! print "Next 10 tokens are:" ! for i in range(10): ! print rcp.lex.get_token(), ! print raise --- 357,367 ---- rcp.loadDialogs(rc_file) except: ! lex = getattr(rcp, "lex", None) ! if lex: ! print "ERROR parsing dialogs at line", lex.lineno ! print "Next 10 tokens are:" ! for i in range(10): ! print lex.get_token(), ! print raise From mhammond at users.sourceforge.net Tue Aug 26 01:25:44 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 03:26:01 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.26, 1.27 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv29154 Modified Files: dialog_map.py Log Message: More dialog tweaks, remove the "hidden window" and use a real button. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** dialog_map.py 26 Aug 2003 02:53:39 -0000 1.26 --- dialog_map.py 26 Aug 2003 07:25:41 -0000 1.27 *************** *** 195,200 **** --- 195,204 ---- def ShowAbout(window): + """Opens the SpamBayes documentation in a browser""" window.manager.ShowHtml("about.html") def ShowDataFolder(window): + """Uses Windows Explorer to show where SpamBayes data and configuration + files are stored + """ import os os.startfile(window.manager.windows_data_directory) *************** *** 416,421 **** (EditNumberProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Filter.timer_interval", 0, 10, 20), (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Filter.timer_only_receive_folders"), - (HiddenDialogCommand, "IDC_HIDDEN", "IDD_DIAGNOSTIC"), (CommandButtonProcessor, "IDC_SHOW_DATA_FOLDER", ShowDataFolder, ()), ), "IDD_DIAGNOSTIC" : ( --- 420,425 ---- (EditNumberProcessor, "IDC_DELAY2_TEXT IDC_DELAY2_SLIDER", "Filter.timer_interval", 0, 10, 20), (BoolButtonProcessor, "IDC_INBOX_TIMER_ONLY", "Filter.timer_only_receive_folders"), (CommandButtonProcessor, "IDC_SHOW_DATA_FOLDER", ShowDataFolder, ()), + (DialogCommand, "IDC_BUT_SHOW_DIAGNOSTICS", "IDD_DIAGNOSTIC"), ), "IDD_DIAGNOSTIC" : ( From mhammond at users.sourceforge.net Tue Aug 26 01:25:44 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 03:26:12 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.h, 1.16, 1.17 dialogs.rc, 1.26, 1.27 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv29154/resources Modified Files: dialogs.h dialogs.rc Log Message: More dialog tweaks, remove the "hidden window" and use a real button. Index: dialogs.h =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** dialogs.h 26 Aug 2003 02:53:39 -0000 1.16 --- dialogs.h 26 Aug 2003 07:25:42 -0000 1.17 *************** *** 71,77 **** #define IDC_STATUS2 1044 #define IDC_BUT_CLEARALL2 1045 ! #define IDC_BUT_NEW 1045 ! #define IDC_MARK_SPAM_AS_READ 1048 ! #define IDC_SAVE_SPAM_SCORE 1050 #define IDC_MARK_UNSURE_AS_READ 1051 #define IDC_ADVANCED_BTN 1055 --- 71,77 ---- #define IDC_STATUS2 1044 #define IDC_BUT_CLEARALL2 1045 ! #define IDC_BUT_NEW 1046 ! #define IDC_MARK_SPAM_AS_READ 1047 ! #define IDC_SAVE_SPAM_SCORE 1048 #define IDC_MARK_UNSURE_AS_READ 1051 #define IDC_ADVANCED_BTN 1055 *************** *** 97,105 **** #define IDC_FORWARD_BTN 1077 #define IDC_PAGE_PLACEHOLDER 1078 #define IDC_BUT_PREPARATION 1081 #define IDC_FOLDER_HAM 1083 #define IDC_BUT_UNTRAINED 1088 #define IDC_BUT_TRAIN 1089 - #define IDC_CHECK1 1090 #define IDC_BUT_TIMER_ENABLED 1091 --- 97,106 ---- #define IDC_FORWARD_BTN 1077 #define IDC_PAGE_PLACEHOLDER 1078 + #define IDC_SHOW_DATA_FOLDER2 1079 + #define IDC_BUT_SHOW_DIAGNOSTICS 1080 #define IDC_BUT_PREPARATION 1081 #define IDC_FOLDER_HAM 1083 #define IDC_BUT_UNTRAINED 1088 #define IDC_BUT_TRAIN 1089 #define IDC_BUT_TIMER_ENABLED 1091 *************** *** 108,112 **** #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 124 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1092 --- 109,113 ---- #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 125 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1092 Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** dialogs.rc 26 Aug 2003 03:07:16 -0000 1.26 --- dialogs.rc 26 Aug 2003 07:25:42 -0000 1.27 *************** *** 28,32 **** // ! IDD_ADVANCED DIALOGEX 0, 0, 248, 179 STYLE DS_SETFONT | DS_MODALFRAME | WS_CHILD | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP --- 28,32 ---- // ! IDD_ADVANCED DIALOGEX 0, 0, 248, 209 STYLE DS_SETFONT | DS_MODALFRAME | WS_CHILD | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP *************** *** 48,56 **** IDC_INBOX_TIMER_ONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,100,217,10 ! LTEXT "I'm not here. Don't Right Click me.",IDC_HIDDEN,172,128, ! 69,46 ! PUSHBUTTON "Show Data Folder",IDC_SHOW_DATA_FOLDER,16,127,60,14 CONTROL "Enable background filtering?",IDC_BUT_TIMER_ENABLED, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,12,162,10 END --- 48,55 ---- IDC_INBOX_TIMER_ONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,100,217,10 ! PUSHBUTTON "Show Data Folder",IDC_SHOW_DATA_FOLDER,16,127,70,14 CONTROL "Enable background filtering?",IDC_BUT_TIMER_ENABLED, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,12,162,10 + PUSHBUTTON "Diagnostics...",IDC_BUT_SHOW_DIAGNOSTICS,163,126,70,14 END *************** *** 118,122 **** END ! IDD_DIAGNOSTIC DIALOGEX 0, 0, 179, 52 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU --- 117,121 ---- END ! IDD_DIAGNOSTIC DIALOGEX 0, 0, 183, 89 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU *************** *** 124,133 **** FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN ! DEFPUSHBUTTON "OK",IDOK,122,7,50,14 ! PUSHBUTTON "Cancel",IDCANCEL,122,24,50,14 CONTROL "Save Spam Score",IDC_SAVE_SPAM_SCORE,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,7,7,72,10 ! LTEXT "Log level",IDC_STATIC,7,29,29,8 ! EDITTEXT IDC_VERBOSE_LOG,43,25,40,14,ES_AUTOHSCROLL END --- 123,134 ---- FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN ! DEFPUSHBUTTON "OK",IDOK,129,50,50,14 ! PUSHBUTTON "Cancel",IDCANCEL,129,70,50,14 CONTROL "Save Spam Score",IDC_SAVE_SPAM_SCORE,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,5,49,72,10 ! LTEXT "Log level",IDC_STATIC,5,71,29,8 ! EDITTEXT IDC_VERBOSE_LOG,41,67,40,14,ES_AUTOHSCROLL ! LTEXT "These advanced options are for diagnostic or debugging purposes only. You should only change these options if specifically asked to, or you know exactly what they mean", ! IDC_STATIC,5,3,174,36 END *************** *** 348,352 **** RIGHTMARGIN, 241 VERTGUIDE, 16 ! BOTTOMMARGIN, 174 END --- 349,353 ---- RIGHTMARGIN, 241 VERTGUIDE, 16 ! BOTTOMMARGIN, 204 END *************** *** 372,375 **** --- 373,383 ---- END + IDD_DIAGNOSTIC, DIALOG + BEGIN + LEFTMARGIN, 5 + RIGHTMARGIN, 179 + BOTTOMMARGIN, 84 + END + IDD_WIZARD, DIALOG BEGIN *************** *** 482,488 **** FONT 8, "Tahoma", 0, 0, 0x1 BEGIN ! LTEXT "SpamBayes Version Here",IDC_VERSION,6,62,242,8 LTEXT "SpamBayes requires training before it is effective. Click on the 'Training' tab, or use the Configuration Wizard to train", ! IDC_STATIC,6,77,242,17 LTEXT "Training database status:",IDC_STATIC,6,97,222,8 LTEXT "123 spam messages; 456 good messages", --- 490,496 ---- FONT 8, "Tahoma", 0, 0, 0x1 BEGIN ! LTEXT "SpamBayes Version Here",IDC_VERSION,6,54,242,8 LTEXT "SpamBayes requires training before it is effective. Click on the 'Training' tab, or use the Configuration Wizard to train", ! IDC_STATIC,6,70,242,17 LTEXT "Training database status:",IDC_STATIC,6,97,222,8 LTEXT "123 spam messages; 456 good messages", From mhammond at users.sourceforge.net Tue Aug 26 01:37:38 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 03:38:00 2003 Subject: [Spambayes-checkins] website/scripts/ht2html SpamBayesGenerator.py, 1.6, 1.7 Message-ID: Update of /cvsroot/spambayes/website/scripts/ht2html In directory sc8-pr-cvs1:/tmp/cvs-serv30810 Modified Files: SpamBayesGenerator.py Log Message: Stop SpamBayes giving page impression credits to the pydns project!! (I wondered why our activity there was so low :) Index: SpamBayesGenerator.py =================================================================== RCS file: /cvsroot/spambayes/website/scripts/ht2html/SpamBayesGenerator.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SpamBayesGenerator.py 26 Jun 2003 03:01:07 -0000 1.6 --- SpamBayesGenerator.py 26 Aug 2003 07:37:35 -0000 1.7 *************** *** 38,45 **** # it is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up ! p.sidebar.append(('http://sourceforge.net', '''
    ''')) self.__linkfixer.massage(p.sidebar, self.__d) --- 38,45 ---- # it is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up ! p.sidebar.append(('http://sourceforge.net/projects/spambayes', '''
    ''')) self.__linkfixer.massage(p.sidebar, self.__d) From anthony at interlink.com.au Tue Aug 26 18:40:44 2003 From: anthony at interlink.com.au (Anthony Baxter) Date: Tue Aug 26 03:41:07 2003 Subject: [Spambayes-checkins] website/scripts/ht2html SpamBayesGenerator.py, 1.6, 1.7 In-Reply-To: Message-ID: <200308260740.h7Q7ej9N013605@localhost.localdomain> >>> "Mark Hammond" wrote > Update of /cvsroot/spambayes/website/scripts/ht2html > In directory sc8-pr-cvs1:/tmp/cvs-serv30810 > > Modified Files: > SpamBayesGenerator.py > Log Message: > Stop SpamBayes giving page impression credits to the pydns project!! > (I wondered why our activity there was so low :) Woops. Let's hear it for cut and paste errors :) Anthony -- Anthony Baxter It's never too late to have a happy childhood. From ta-meyer at ihug.co.nz Tue Aug 26 20:44:06 2003 From: ta-meyer at ihug.co.nz (Tony Meyer) Date: Tue Aug 26 03:44:41 2003 Subject: [Spambayes-checkins] website/scripts/ht2htmlSpamBayesGenerator.py, 1.6, 1.7 In-Reply-To: <1ED4ECF91CDED24C8D012BCF2B034F1303063F91@its-xchg4.massey.ac.nz> Message-ID: <1ED4ECF91CDED24C8D012BCF2B034F130212AD61@its-xchg4.massey.ac.nz> > > Modified Files: > > SpamBayesGenerator.py > > Log Message: > > Stop SpamBayes giving page impression credits to the pydns project!! > > (I wondered why our activity there was so low :) > > Woops. Let's hear it for cut and paste errors :) I'm pretty impressed that Mark found that, given that it's the project number and not name... =Tony Meyer From mhammond at users.sourceforge.net Tue Aug 26 02:08:59 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 04:54:22 2003 Subject: [Spambayes-checkins] website index.ht,1.22,1.23 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv2643 Modified Files: index.ht Log Message: Give out a bit more credit :) Index: index.ht =================================================================== RCS file: /cvsroot/spambayes/website/index.ht,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** index.ht 13 Aug 2003 08:31:19 -0000 1.22 --- index.ht 26 Aug 2003 08:08:57 -0000 1.23 *************** *** 155,159 **** background page for a link). Rob Hooft also contributed maths/stats clues. ! Mark Hammond amazed the world with the Outlook2000 plug-in, and Richie Hindle, Neale Pickett, Tim Stone worked on the end-user applications.

    (Thanks also to Rachel Holkner for turning Anthony's gibberish into something --- 155,160 ---- background page for a link). Rob Hooft also contributed maths/stats clues. ! Mark Hammond amazed the world with the Outlook2000 plug-in (with Tony Meyer ! Sean True and Adam Walker making significant contributions), and Richie Hindle, Neale Pickett, Tim Stone worked on the end-user applications.

    (Thanks also to Rachel Holkner for turning Anthony's gibberish into something From mhammond at users.sourceforge.net Tue Aug 26 02:12:22 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 04:54:32 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 config_wizard.py, 1.5, 1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv3074 Modified Files: config_wizard.py Log Message: Default folder names used by the Wizard are now "Junk E-Mail" and "Junk Suspects", with the former apparently being the name used by Outlook XP. Index: config_wizard.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/config_wizard.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config_wizard.py 24 Aug 2003 13:25:12 -0000 1.5 --- config_wizard.py 26 Aug 2003 08:12:20 -0000 1.6 *************** *** 23,31 **** config.BOOLEAN, config.RESTORE), # Spam ! ("spam_folder_name", "Name of spam folder - ignored if ID set", "Spam", """""", "", config.RESTORE), # unsure ! ("unsure_folder_name", "Name of unsure folder - ignored if ID set", "Maybe Spam", """""", "", config.RESTORE), --- 23,31 ---- config.BOOLEAN, config.RESTORE), # Spam ! ("spam_folder_name", "Name of spam folder - ignored if ID set", "Junk E-Mail", """""", "", config.RESTORE), # unsure ! ("unsure_folder_name", "Name of unsure folder - ignored if ID set", "Junk Suspects", """""", "", config.RESTORE), From mhammond at users.sourceforge.net Tue Aug 26 02:03:01 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 04:54:55 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.67,1.68 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv1490 Modified Files: msgstore.py Log Message: Fix [ 779319 ] ntpath Unicode error Return the profile name as a Unicode object, rather than as a string with invalid ascii characters. Index: msgstore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** msgstore.py 26 Aug 2003 06:01:46 -0000 1.67 --- msgstore.py 26 Aug 2003 08:02:59 -0000 1.68 *************** *** 186,190 **** assert len(rows)==1, "Should be exactly one row" (tag, val), = rows[0] ! return val def _GetMessageStore(self, store_eid): # bin eid. --- 186,192 ---- assert len(rows)==1, "Should be exactly one row" (tag, val), = rows[0] ! # I can't convince MAPI to give me the Unicode name, so we assume ! # encoded as MBCS. ! return val.decode("mbcs", "ignore") def _GetMessageStore(self, store_eid): # bin eid. From mhammond at users.sourceforge.net Tue Aug 26 04:57:46 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 06:58:32 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources rc2py.py, 1.5, 1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv25926 Modified Files: rc2py.py Log Message: Write the size and time of the .rc file, and don't bother deriving from object. Index: rc2py.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/rc2py.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rc2py.py 20 Aug 2003 01:18:03 -0000 1.5 --- rc2py.py 26 Aug 2003 10:57:44 -0000 1.6 *************** *** 8,12 **** with the same basic public interface as the rcparser module. """ ! import sys, os import rcparser --- 8,12 ---- with the same basic public interface as the rcparser module. """ ! import sys, os, stat import rcparser *************** *** 18,26 **** outputFilename = "test.py" rcp = rcparser.ParseDialogs(inputFilename) out = open(outputFilename, "wt") out.write("#%s\n" % outputFilename) out.write("#This is a generated file. Please edit %s instead.\n" % inputFilename) ! out.write("class FakeParser(object):\n") out.write("\tdialogs = "+repr(rcp.dialogs)+"\n") out.write("\tids = "+repr(rcp.ids)+"\n") --- 18,28 ---- outputFilename = "test.py" rcp = rcparser.ParseDialogs(inputFilename) + in_stat = os.stat(inputFilename) out = open(outputFilename, "wt") out.write("#%s\n" % outputFilename) out.write("#This is a generated file. Please edit %s instead.\n" % inputFilename) ! out.write("_rc_size_=%d\n_rc_mtime_=%d\n" % (in_stat[stat.ST_SIZE], in_stat[stat.ST_MTIME])) ! out.write("class FakeParser:\n") out.write("\tdialogs = "+repr(rcp.dialogs)+"\n") out.write("\tids = "+repr(rcp.ids)+"\n") From mhammond at users.sourceforge.net Tue Aug 26 04:59:13 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 06:59:56 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs __init__.py, 1.7, 1.8 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv26146 Modified Files: __init__.py Log Message: Use rc2py so that dialog resources are loaded from a .py file instead of parsed each time. This .py file is generated in source-code versions when the .rc file no longer matches the .py Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** __init__.py 24 Aug 2003 13:23:04 -0000 1.7 --- __init__.py 26 Aug 2003 10:59:11 -0000 1.8 *************** *** 1,11 **** # This package defines dialog boxes used by the main # SpamBayes Outlook 2k integration code. ! def LoadDialogs(rc_file = "dialogs.rc"): ! import os ! from resources import rcparser ! if not os.path.isabs(rc_file): ! rc_file = os.path.join( os.path.dirname( rcparser.__file__ ), rc_file) ! return rcparser.ParseDialogs(rc_file) def ShowDialog(parent, manager, config, idd): --- 1,45 ---- # This package defines dialog boxes used by the main # SpamBayes Outlook 2k integration code. + import os, sys, stat ! def LoadDialogs(rc_name = "dialogs.rc"): ! base_name = os.path.splitext(rc_name)[0] ! mod_name = "resources." + base_name ! mod = None ! # If we are running from source code, check the .py file is up to date ! # wrt the .rc file passed in. ! # If we are running from binaries, the rc name is not used at all - we ! # assume someone running from source previously generated the .py! ! if not hasattr(sys, "frozen"): ! from resources import rc2py ! rc_path = os.path.dirname( rc2py.__file__ ) ! if not os.path.isabs(rc_name): ! rc_name = os.path.join( rc_path, rc_name) ! py_name = os.path.join(rc_path, base_name + ".py") ! mtime = size = None ! if os.path.exists(py_name): ! try: ! mod = __import__(mod_name) ! # mod is the top-level 'resources' module ! mod = getattr(mod, base_name) ! mtime = mod._rc_mtime_ ! size = mod._rc_size_ ! except (ImportError, AttributeError): ! mtime = None ! try: ! stat_data = os.stat(rc_name) ! rc_mtime = stat_data[stat.ST_MTIME] ! rc_size = stat_data[stat.ST_SIZE] ! except OSError: ! rc_mtime = None ! if rc_mtime!=mtime or rc_size!=size: ! # Need to generate the dialog. ! print "Generating %s from %s" % (py_name, rc_name) ! rc2py.convert(rc_name, py_name) ! if mod is None: ! mod = __import__(mod_name) ! # mod is the top-level 'resources' module ! mod = getattr(mod, base_name) ! return mod.FakeParser() def ShowDialog(parent, manager, config, idd): *************** *** 48,52 **** dlg = dlgcore.ProcessorPage(parent, manager, config, idd, commands, yoffset) return dlg ! import dlgutils SetWaitCursor = dlgutils.SetWaitCursor --- 82,86 ---- dlg = dlgcore.ProcessorPage(parent, manager, config, idd, commands, yoffset) return dlg ! import dlgutils SetWaitCursor = dlgutils.SetWaitCursor From mhammond at users.sourceforge.net Tue Aug 26 04:56:34 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 07:01:14 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources .cvsignore, 1.2, 1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv25810 Modified Files: .cvsignore Log Message: Ignore generated .py file. Index: .cvsignore =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 10 Aug 2003 07:26:50 -0000 1.2 --- .cvsignore 26 Aug 2003 10:56:32 -0000 1.3 *************** *** 1,2 **** --- 1,3 ---- dialogs.aps + dialogs.py *.pyc From mhammond at users.sourceforge.net Tue Aug 26 05:11:39 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 07:12:23 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.27, 1.28 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv27931 Modified Files: dialogs.rc Log Message: Fiddle with size and pos of folder name controls in filter dialog Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** dialogs.rc 26 Aug 2003 07:25:42 -0000 1.27 --- dialogs.rc 26 Aug 2003 11:11:37 -0000 1.28 *************** *** 598,607 **** EDITTEXT IDC_EDIT_CERTAIN,184,53,51,14,ES_AUTOHSCROLL LTEXT "and these messages should be:",IDC_STATIC,13,72,107,10 ! COMBOBOX IDC_ACTION_CERTAIN,13,83,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "to folder",IDC_STATIC,75,85,31,10 CONTROL "Folder names...",IDC_FOLDER_CERTAIN,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | ! WS_GROUP,120,83,59,14 PUSHBUTTON "Browse",IDC_BROWSE_CERTAIN,184,83,50,14 GROUPBOX "Possible Spam",IDC_STATIC,6,117,235,81 --- 598,607 ---- EDITTEXT IDC_EDIT_CERTAIN,184,53,51,14,ES_AUTOHSCROLL LTEXT "and these messages should be:",IDC_STATIC,13,72,107,10 ! COMBOBOX IDC_ACTION_CERTAIN,12,83,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "to folder",IDC_STATIC,71,85,28,10 CONTROL "Folder names...",IDC_FOLDER_CERTAIN,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | ! WS_GROUP,102,83,77,14 PUSHBUTTON "Browse",IDC_BROWSE_CERTAIN,184,83,50,14 GROUPBOX "Possible Spam",IDC_STATIC,6,117,235,81 *************** *** 614,621 **** COMBOBOX IDC_ACTION_UNSURE,12,166,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "to folder",IDC_STATIC,74,169,31,10 CONTROL "(folder name)",IDC_FOLDER_UNSURE,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | ! WS_GROUP,119,166,59,14 PUSHBUTTON "&Browse",IDC_BROWSE_UNSURE,183,166,50,14 CONTROL "Mark spam as read",IDC_MARK_SPAM_AS_READ,"Button", --- 614,621 ---- COMBOBOX IDC_ACTION_UNSURE,12,166,55,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP ! LTEXT "to folder",IDC_STATIC,71,169,27,10 CONTROL "(folder name)",IDC_FOLDER_UNSURE,"Static", SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | SS_SUNKEN | ! WS_GROUP,102,166,77,14 PUSHBUTTON "&Browse",IDC_BROWSE_UNSURE,183,166,50,14 CONTROL "Mark spam as read",IDC_MARK_SPAM_AS_READ,"Button", From gward at users.sourceforge.net Tue Aug 26 06:57:33 2003 From: gward at users.sourceforge.net (Greg Ward) Date: Tue Aug 26 08:58:32 2003 Subject: [Spambayes-checkins] spambayes/spambayes hammie.py,1.6,1.7 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv13011/spambayes Modified Files: hammie.py Log Message: Fix syntax error (missing paren). Index: hammie.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/hammie.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** hammie.py 25 Aug 2003 09:00:36 -0000 1.6 --- hammie.py 26 Aug 2003 12:57:31 -0000 1.7 *************** *** 255,259 **** if needed), 'r' for read-only, 'w' for read-write. """ ! return Hammie(storage.open_storage((filename, mode), useDB) --- 255,259 ---- if needed), 'r' for read-only, 'w' for read-write. """ ! return Hammie(storage.open_storage((filename, mode), useDB)) From mhammond at users.sourceforge.net Tue Aug 26 07:07:53 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 09:09:30 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.99,1.100 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv14398 Modified Files: addin.py Log Message: For the sake of many lines of code, insist source users are running from win32all 151 or later (which most would, as there would have been a number of warnings printed for quite some time) Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** addin.py 26 Aug 2003 02:35:45 -0000 1.99 --- addin.py 26 Aug 2003 13:07:50 -0000 1.100 *************** *** 98,167 **** # win32all 155 and earlier don't like us pre-generating :( universal.RegisterInterfaces('{AC0714F2-3D04-11D1-AE7D-00A0C90F26F4}', 0, 1, 0, ["_IDTExtensibility2"]) - - # A couple of functions that are in new win32all, but we dont want to - # force people to ugrade if we can avoid it. - # NOTE: Most docstrings and comments removed - see the win32all version - def CastToClone(ob, target): - """'Cast' a COM object to another type""" - if hasattr(target, "index"): # string like - # for now, we assume makepy for this to work. - if not ob.__class__.__dict__.has_key("CLSID"): - ob = gencache.EnsureDispatch(ob) - if not ob.__class__.__dict__.has_key("CLSID"): - raise ValueError, "Must be a makepy-able object for this to work" - clsid = ob.CLSID - mod = gencache.GetModuleForCLSID(clsid) - mod = gencache.GetModuleForTypelib(mod.CLSID, mod.LCID, - mod.MajorVersion, mod.MinorVersion) - # XXX - should not be looking in VTables..., but no general map currently exists - # (Fixed in win32all!) - target_clsid = mod.VTablesNamesToIIDMap.get(target) - if target_clsid is None: - raise ValueError, "The interface name '%s' does not appear in the " \ - "same library as object '%r'" % (target, ob) - mod = gencache.GetModuleForCLSID(target_clsid) - target_class = getattr(mod, target) - target_class = getattr(target_class, "default_interface", target_class) - return target_class(ob) # auto QI magic happens - raise ValueError, "Don't know what to do with '%r'" % (ob,) - try: - from win32com.client import CastTo - except ImportError: # appears in 151 and later. - CastTo = CastToClone - - # Something else in later win32alls - like "DispatchWithEvents", but the - # returned object is not both the Dispatch *and* the event handler - def WithEventsClone(clsid, user_event_class): - clsid = getattr(clsid, "_oleobj_", clsid) - disp = Dispatch(clsid) - if not disp.__dict__.get("CLSID"): # Eeek - no makepy support - try and build it. - try: - ti = disp._oleobj_.GetTypeInfo() - disp_clsid = ti.GetTypeAttr()[0] - tlb, index = ti.GetContainingTypeLib() - tla = tlb.GetLibAttr() - gencache.EnsureModule(tla[0], tla[1], tla[3], tla[4]) - disp_class = gencache.GetClassForProgID(str(disp_clsid)) - except pythoncom.com_error: - raise TypeError, "This COM object can not automate the makepy process - please run makepy manually for this object" - else: - disp_class = disp.__class__ - clsid = disp_class.CLSID - import new - events_class = getevents(clsid) - if events_class is None: - raise ValueError, "This COM object does not support events." - result_class = new.classobj("COMEventClass", (events_class, user_event_class), {}) - instance = result_class(disp) # This only calls the first base class __init__. - if hasattr(user_event_class, "__init__"): - user_event_class.__init__(instance) - return instance - try: ! from win32com.client import WithEvents ! except ImportError: # appears in 151 and later. ! WithEvents = WithEventsClone ! ! # Whew - we seem to have all the COM support we need - let's rock! # Determine if we have ever seen a message before. If we have saved the spam --- 98,109 ---- # win32all 155 and earlier don't like us pre-generating :( universal.RegisterInterfaces('{AC0714F2-3D04-11D1-AE7D-00A0C90F26F4}', 0, 1, 0, ["_IDTExtensibility2"]) try: ! from win32com.client import CastTo, WithEvents ! except ImportError: ! print "*" * 50 ! print "You appear to be running a win32all version pre 151, which is pretty old" ! print "I'm afraid it is time to upgrade" ! raise ! # we seem to have all the COM support we need - let's rock! # Determine if we have ever seen a message before. If we have saved the spam From xenogeist at users.sourceforge.net Tue Aug 26 07:37:52 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Tue Aug 26 09:38:01 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.100,1.101 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv19914/Outlook2000 Modified Files: addin.py Log Message: filer->filter Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** addin.py 26 Aug 2003 13:07:50 -0000 1.100 --- addin.py 26 Aug 2003 13:37:49 -0000 1.101 *************** *** 254,258 **** # the timer for known 'inbox' folders, or for all watched folders. is_inbox = self.target.IsReceiveFolder() ! if not is_inbox and self.manager.config.filer.timer_only_receive_folders: use_timer = False --- 254,258 ---- # the timer for known 'inbox' folders, or for all watched folders. is_inbox = self.target.IsReceiveFolder() ! if not is_inbox and self.manager.config.filter.timer_only_receive_folders: use_timer = False From mhammond at users.sourceforge.net Tue Aug 26 07:42:30 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 09:42:47 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs __init__.py, 1.8, 1.9 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv20604 Modified Files: __init__.py Log Message: Oops - use fully qualified module names in the resource generation. Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** __init__.py 26 Aug 2003 10:59:11 -0000 1.8 --- __init__.py 26 Aug 2003 13:42:28 -0000 1.9 *************** *** 5,9 **** def LoadDialogs(rc_name = "dialogs.rc"): base_name = os.path.splitext(rc_name)[0] ! mod_name = "resources." + base_name mod = None # If we are running from source code, check the .py file is up to date --- 5,9 ---- def LoadDialogs(rc_name = "dialogs.rc"): base_name = os.path.splitext(rc_name)[0] ! mod_name = "dialogs.resources." + base_name mod = None # If we are running from source code, check the .py file is up to date *************** *** 21,26 **** try: mod = __import__(mod_name) ! # mod is the top-level 'resources' module ! mod = getattr(mod, base_name) mtime = mod._rc_mtime_ size = mod._rc_size_ --- 21,25 ---- try: mod = __import__(mod_name) ! mod = sys.modules[mod_name] mtime = mod._rc_mtime_ size = mod._rc_size_ *************** *** 39,44 **** if mod is None: mod = __import__(mod_name) ! # mod is the top-level 'resources' module ! mod = getattr(mod, base_name) return mod.FakeParser() --- 38,42 ---- if mod is None: mod = __import__(mod_name) ! mod = sys.modules[mod_name] return mod.FakeParser() From xenogeist at users.sourceforge.net Tue Aug 26 15:29:10 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Tue Aug 26 17:29:15 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs __init__.py, 1.9, 1.10 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv6475/Outlook2000/dialogs Modified Files: __init__.py Log Message: reload the dialogs mod after generating it. Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** __init__.py 26 Aug 2003 13:42:28 -0000 1.9 --- __init__.py 26 Aug 2003 21:29:08 -0000 1.10 *************** *** 36,39 **** --- 36,41 ---- print "Generating %s from %s" % (py_name, rc_name) rc2py.convert(rc_name, py_name) + if mod is not None: + reload(mod) if mod is None: mod = __import__(mod_name) From xenogeist at users.sourceforge.net Tue Aug 26 15:41:21 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Tue Aug 26 17:41:24 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.27, 1.28 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv9135/Outlook2000/dialogs Modified Files: dialog_map.py Log Message: Added the graphic for the wizard (nothing fancy). More full-stops in the dialogs. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** dialog_map.py 26 Aug 2003 07:25:41 -0000 1.27 --- dialog_map.py 26 Aug 2003 21:41:18 -0000 1.28 *************** *** 430,433 **** --- 430,434 ---- # All the wizards "IDD_WIZARD": ( + (ImageProcessor, "IDC_WIZ_GRAPHIC"), (CloseButtonProcessor, "IDCANCEL"), (wiz.ConfigureWizardProcessor, "IDC_FORWARD_BTN IDC_BACK_BTN IDC_PAGE_PLACEHOLDER", From xenogeist at users.sourceforge.net Tue Aug 26 15:41:21 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Tue Aug 26 17:41:34 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources sbwizlogo.bmp, NONE, 1.1 dialogs.h, 1.17, 1.18 dialogs.rc, 1.28, 1.29 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv9135/Outlook2000/dialogs/resources Modified Files: dialogs.h dialogs.rc Added Files: sbwizlogo.bmp Log Message: Added the graphic for the wizard (nothing fancy). More full-stops in the dialogs. --- NEW FILE: sbwizlogo.bmp --- (This appears to be a binary file; contents omitted.) Index: dialogs.h =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** dialogs.h 26 Aug 2003 07:25:42 -0000 1.17 --- dialogs.h 26 Aug 2003 21:41:19 -0000 1.18 *************** *** 25,28 **** --- 25,29 ---- #define IDD_WIZARD_TRAINING_IS_IMPORTANT 123 #define IDD_WIZARD_FINISHED_TRAIN_LATER 124 + #define IDB_SBWIZLOGO 125 #define IDC_PROGRESS 1000 #define IDC_PROGRESS_TEXT 1001 *************** *** 104,107 **** --- 105,109 ---- #define IDC_BUT_TRAIN 1089 #define IDC_BUT_TIMER_ENABLED 1091 + #define IDC_WIZ_GRAPHIC 1092 // Next default values for new objects *************** *** 109,115 **** #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 125 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1092 #define _APS_NEXT_SYMED_VALUE 101 #endif --- 111,117 ---- #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS ! #define _APS_NEXT_RESOURCE_VALUE 126 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1093 #define _APS_NEXT_SYMED_VALUE 101 #endif Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** dialogs.rc 26 Aug 2003 11:11:37 -0000 1.28 --- dialogs.rc 26 Aug 2003 21:41:19 -0000 1.29 *************** *** 129,137 **** LTEXT "Log level",IDC_STATIC,5,71,29,8 EDITTEXT IDC_VERBOSE_LOG,41,67,40,14,ES_AUTOHSCROLL ! LTEXT "These advanced options are for diagnostic or debugging purposes only. You should only change these options if specifically asked to, or you know exactly what they mean", IDC_STATIC,5,3,174,36 END ! IDD_WIZARD DIALOGEX 0, 0, 390, 203 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP --- 129,137 ---- LTEXT "Log level",IDC_STATIC,5,71,29,8 EDITTEXT IDC_VERBOSE_LOG,41,67,40,14,ES_AUTOHSCROLL ! LTEXT "These advanced options are for diagnostic or debugging purposes only. You should only change these options if specifically asked to, or you know exactly what they mean.", IDC_STATIC,5,3,174,36 END ! IDD_WIZARD DIALOGEX 0, 0, 384, 190 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP *************** *** 139,149 **** FONT 8, "Tahoma", 400, 0, 0x0 BEGIN ! PUSHBUTTON "Cancel",IDCANCEL,333,182,50,14 ! LTEXT "Logo Here after we figure out dialog size",IDC_STATIC,7, ! 7,68,189,SS_SUNKEN ! PUSHBUTTON "<< Back",IDC_BACK_BTN,216,182,50,14 ! DEFPUSHBUTTON "Next>>,Finish",IDC_FORWARD_BTN,273,182,50,14 ! CONTROL "",IDC_PAGE_PLACEHOLDER,"Static",SS_ETCHEDFRAME,80,7,303, 167 END --- 139,148 ---- FONT 8, "Tahoma", 400, 0, 0x0 BEGIN ! PUSHBUTTON "Cancel",IDCANCEL,328,173,50,14 ! PUSHBUTTON "<< Back",IDC_BACK_BTN,216,173,50,14 ! DEFPUSHBUTTON "Next>>,Finish",IDC_FORWARD_BTN,269,173,50,14 ! CONTROL "",IDC_PAGE_PLACEHOLDER,"Static",SS_ETCHEDFRAME,75,4,303, 167 + CONTROL 125,IDC_WIZ_GRAPHIC,"Static",SS_BITMAP,0,0,69,190 END *************** *** 382,389 **** IDD_WIZARD, DIALOG BEGIN ! LEFTMARGIN, 7 ! RIGHTMARGIN, 383 ! TOPMARGIN, 7 ! BOTTOMMARGIN, 196 END --- 381,385 ---- IDD_WIZARD, DIALOG BEGIN ! RIGHTMARGIN, 378 END *************** *** 466,469 **** --- 462,466 ---- IDB_SBLOGO BITMAP "sblogo.bmp" + IDB_SBWIZLOGO BITMAP "sbwizlogo.bmp" #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// *************** *** 491,495 **** BEGIN LTEXT "SpamBayes Version Here",IDC_VERSION,6,54,242,8 ! LTEXT "SpamBayes requires training before it is effective. Click on the 'Training' tab, or use the Configuration Wizard to train", IDC_STATIC,6,70,242,17 LTEXT "Training database status:",IDC_STATIC,6,97,222,8 --- 488,492 ---- BEGIN LTEXT "SpamBayes Version Here",IDC_VERSION,6,54,242,8 ! LTEXT "SpamBayes requires training before it is effective. Click on the 'Training' tab, or use the Configuration Wizard to train.", IDC_STATIC,6,70,242,17 LTEXT "Training database status:",IDC_STATIC,6,97,222,8 From mhammond at users.sourceforge.net Tue Aug 26 18:06:01 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 20:06:05 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs processors.py, 1.8, 1.9 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv32466 Modified Files: processors.py Log Message: In binary builds, look for the bitmaps in the 'images' directory. Index: processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/processors.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** processors.py 24 Aug 2003 12:01:52 -0000 1.8 --- processors.py 27 Aug 2003 00:05:59 -0000 1.9 *************** *** 47,62 **** class ImageProcessor(ControlProcessor): def Init(self): - filename = "" rcp = self.window.manager.dialog_parser; text = win32gui.GetWindowText(self.GetControl()) name = rcp.names[int(text)] filename = rcp.bitmaps[name] ! import os ! if not os.path.isabs(filename): ! filename = os.path.join( os.path.dirname( __file__ ), "resources", filename) handle = win32gui.LoadImage(0, filename, win32con.IMAGE_BITMAP,0,0, win32con.LR_COLOR|win32con.LR_LOADFROMFILE|win32con.LR_SHARED) win32gui.SendMessage(self.GetControl(), win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, handle) - def GetPopupHelpText(self, cid): --- 47,65 ---- class ImageProcessor(ControlProcessor): def Init(self): rcp = self.window.manager.dialog_parser; text = win32gui.GetWindowText(self.GetControl()) name = rcp.names[int(text)] filename = rcp.bitmaps[name] ! import os, sys ! if hasattr(sys, "frozen"): ! # bitmap in the app/images directory ! filename = os.path.join(self.window.manager.application_directory, ! "images", filename) ! else: ! if not os.path.isabs(filename): ! filename = os.path.join( os.path.dirname( __file__ ), "resources", filename) handle = win32gui.LoadImage(0, filename, win32con.IMAGE_BITMAP,0,0, win32con.LR_COLOR|win32con.LR_LOADFROMFILE|win32con.LR_SHARED) win32gui.SendMessage(self.GetControl(), win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, handle) def GetPopupHelpText(self, cid): From mhammond at users.sourceforge.net Tue Aug 26 18:07:09 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 20:07:21 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.28, 1.29 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv32637 Modified Files: dialog_map.py Log Message: Add 'View Log' button to the Diagnostics dialog. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** dialog_map.py 26 Aug 2003 21:41:18 -0000 1.28 --- dialog_map.py 27 Aug 2003 00:07:07 -0000 1.29 *************** *** 203,206 **** --- 203,234 ---- import os os.startfile(window.manager.windows_data_directory) + def ShowLog(window): + """Opens the log file for the current SpamBayes session + """ + import sys, os, win32api + if 1 or hasattr(sys, "frozen"): + # current log always "spambayes1.log" + log_name = os.path.join(win32api.GetTempPath(), "spambayes1.log") + if not os.path.exists(log_name): + window.manager.ReportError("The log file for this session can not be located") + else: + cmd = 'notepad.exe "%s"' % log_name + os.system(cmd) + else: + question = "As you are running from source-code, viewing the\n" \ + "log means executing a Python program. If you already\n" \ + "have a viewer running, the output may appear in either.\n\n"\ + "Do you want to execute this viewer?" + if not window.manager.AskQuestion(question): + return + # source-code users - fire up win32traceutil.py + import win32traceutil # will already be imported + py_name = win32traceutil.__file__ + if py_name[-1] in 'co': # pyc/pyo + py_name = py_name[:-1] + # execute the .py file - hope that this will manage to invoke + # python.exe for it. If this breaks for you, feel free to send me + # a patch :) + os.system('start ' + win32api.GetShortPathName(py_name)) def ResetConfig(window): *************** *** 426,429 **** --- 454,458 ---- (BoolButtonProcessor, "IDC_SAVE_SPAM_SCORE", "Filter.save_spam_info"), (IntProcessor, "IDC_VERBOSE_LOG", "General.verbose"), + (CommandButtonProcessor, "IDC_BUT_VIEW_LOG", ShowLog, ()), (CloseButtonProcessor, "IDOK IDCANCEL"), ), From mhammond at users.sourceforge.net Tue Aug 26 18:07:09 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 20:07:34 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.h, 1.18, 1.19 dialogs.rc, 1.29, 1.30 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv32637/resources Modified Files: dialogs.h dialogs.rc Log Message: Add 'View Log' button to the Diagnostics dialog. Index: dialogs.h =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** dialogs.h 26 Aug 2003 21:41:19 -0000 1.18 --- dialogs.h 27 Aug 2003 00:07:07 -0000 1.19 *************** *** 106,109 **** --- 106,110 ---- #define IDC_BUT_TIMER_ENABLED 1091 #define IDC_WIZ_GRAPHIC 1092 + #define IDC_BUT_VIEW_LOG 1093 // Next default values for new objects *************** *** 113,117 **** #define _APS_NEXT_RESOURCE_VALUE 126 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1093 #define _APS_NEXT_SYMED_VALUE 101 #endif --- 114,118 ---- #define _APS_NEXT_RESOURCE_VALUE 126 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1094 #define _APS_NEXT_SYMED_VALUE 101 #endif Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dialogs.rc 26 Aug 2003 21:41:19 -0000 1.29 --- dialogs.rc 27 Aug 2003 00:07:07 -0000 1.30 *************** *** 117,134 **** END ! IDD_DIAGNOSTIC DIALOGEX 0, 0, 183, 89 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU ! CAPTION "Diagnostic" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - DEFPUSHBUTTON "OK",IDOK,129,50,50,14 - PUSHBUTTON "Cancel",IDCANCEL,129,70,50,14 - CONTROL "Save Spam Score",IDC_SAVE_SPAM_SCORE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,5,49,72,10 - LTEXT "Log level",IDC_STATIC,5,71,29,8 - EDITTEXT IDC_VERBOSE_LOG,41,67,40,14,ES_AUTOHSCROLL LTEXT "These advanced options are for diagnostic or debugging purposes only. You should only change these options if specifically asked to, or you know exactly what they mean.", IDC_STATIC,5,3,174,36 END --- 117,135 ---- END ! IDD_DIAGNOSTIC DIALOGEX 0, 0, 183, 98 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU ! EXSTYLE WS_EX_CONTEXTHELP FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "These advanced options are for diagnostic or debugging purposes only. You should only change these options if specifically asked to, or you know exactly what they mean.", IDC_STATIC,5,3,174,36 + LTEXT "Log file verbosity",IDC_STATIC,5,44,56,8 + EDITTEXT IDC_VERBOSE_LOG,73,42,40,14,ES_AUTOHSCROLL + PUSHBUTTON "View log...",IDC_BUT_VIEW_LOG,129,41,50,14 + CONTROL "Save Spam Score",IDC_SAVE_SPAM_SCORE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,5,63,72,10 + PUSHBUTTON "Cancel",IDCANCEL,69,79,50,14,NOT WS_VISIBLE + DEFPUSHBUTTON "Close",IDOK,129,79,50,14 END *************** *** 376,380 **** LEFTMARGIN, 5 RIGHTMARGIN, 179 ! BOTTOMMARGIN, 84 END --- 377,381 ---- LEFTMARGIN, 5 RIGHTMARGIN, 179 ! BOTTOMMARGIN, 93 END From mhammond at users.sourceforge.net Tue Aug 26 20:11:41 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 22:11:46 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs async_processor.py, 1.5, 1.6 dlgcore.py, 1.11, 1.12 processors.py, 1.9, 1.10 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv17770 Modified Files: async_processor.py dlgcore.py processors.py Log Message: If an async process is running as the dialog dies, wait for it to finish (otherwise the main thread may be get upset, particularly if it is finishing! Index: async_processor.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/async_processor.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** async_processor.py 24 Aug 2003 12:01:52 -0000 1.5 --- async_processor.py 27 Aug 2003 02:11:38 -0000 1.6 *************** *** 124,142 **** win32con.MB_OK | win32con.MB_ICONEXCLAMATION) return not self.running ! # Here is an alternative to stop the process and wait for it to finish ! # But auto-stopping on a tab-switch isn't really what we want. If we ! # were *really* clever, we could allow it to continue - but we aren't. ! #if self.running: ! # self.progress.request_stop() ! # for i in xrange(500): # 5 seconds ! # win32gui.PumpWaitingMessages(0,-1) ! # if i % 50 == 0: ! # print "Still waiting for async process to finish..." ! # time.sleep(0.01) ! # if not self.running: ! # break ! # else: ! # print "XXX - eeek - gave up waiting for async process to stop" ! #return True def GetMessages(self): --- 124,140 ---- win32con.MB_OK | win32con.MB_ICONEXCLAMATION) return not self.running ! def Term(self): ! # The Window is dieing! We *must* kill it and wait for it to finish ! # else bad things happen once the main thread dies before us! ! if self.running: ! self.progress.request_stop() ! i = 0 ! while self.running: ! win32gui.PumpWaitingMessages(0,-1) ! if i % 100 == 0: ! print "Still waiting for async process to finish..." ! time.sleep(0.01) ! i += 1 ! return True def GetMessages(self): Index: dlgcore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dlgcore.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dlgcore.py 24 Aug 2003 14:07:09 -0000 1.11 --- dlgcore.py 27 Aug 2003 02:11:38 -0000 1.12 *************** *** 247,250 **** --- 247,252 ---- def OnDestroy(self, hwnd, msg, wparam, lparam): #print "OnDestroy" + for p in self.all_processors: + p.Term() TooltipDialog.OnDestroy(self, hwnd, msg, wparam, lparam) self.command_processors = None Index: processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/processors.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** processors.py 27 Aug 2003 00:05:59 -0000 1.9 --- processors.py 27 Aug 2003 02:11:38 -0000 1.10 *************** *** 19,24 **** def Init(self): pass ! def Done(self): return True def GetControl(self, control_id = None): control_id = control_id or self.control_id --- 19,26 ---- def Init(self): pass ! def Done(self): # done with 'ok' - ie, save options. May return false. return True + def Term(self): # closing - can't fail. + pass def GetControl(self, control_id = None): control_id = control_id or self.control_id From mhammond at users.sourceforge.net Tue Aug 26 21:34:42 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Tue Aug 26 23:34:46 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 train.py,1.31,1.32 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv30912 Modified Files: train.py Log Message: Fix [ 795749 ] "Score after training" doesn't in CVS Index: train.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/train.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** train.py 24 Aug 2003 07:57:43 -0000 1.31 --- train.py 27 Aug 2003 03:34:40 -0000 1.32 *************** *** 181,185 **** config.include_sub = mgr.config.training.ham_include_sub or mgr.config.training.spam_include_sub import filter ! filter.filterer(mgr, progress) bayes = classifier_data.bayes --- 181,185 ---- config.include_sub = mgr.config.training.ham_include_sub or mgr.config.training.spam_include_sub import filter ! filter.filterer(mgr, mgr.config, progress) bayes = classifier_data.bayes From anadelonbrin at users.sourceforge.net Tue Aug 26 21:53:05 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Aug 26 23:53:09 2003 Subject: [Spambayes-checkins] website faq.txt,1.38,1.39 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv1018 Modified Files: faq.txt Log Message: Tidy up the FAQs about creating a bayescustomize.ini file. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** faq.txt 25 Aug 2003 19:26:08 -0000 1.38 --- faq.txt 27 Aug 2003 03:53:03 -0000 1.39 *************** *** 581,626 **** - How do I configure Spambayes? - ----------------------------- - - The system is configured through a file called "bayescustomize.ini". In - here you can configure the name and type of your database, the POP3 - server(s) you want to proxy to, the ports you want the proxy and the web - interface to run on, and so on. You can also control details like how sure - you want the system to be that message really is spam before it marks it as - such. The default values for all the options, and the documentation for - them, all lives in Options.py. - - To change an option, create a bayescustomize.ini and add the option to that - - don't edit Options.py. If you are using the POP3 proxy, SMTP proxy or IMAP - filter, you can also change most of the options you will need to access via - the web user interface. You will probably find this at - http://localhost:8880. To configure the Outlook plugin, you should click on - the Anti-Spam button on the toolbar. - - To setup the POP3 and SMTP proxies (optional), run:: - - pop3proxy.py -b - - from the command line. The web interface should open in your default - browser. You need to click on the "Configuration Link" to go to the setup - page. The minimum you need to do to get started is enter the servers and - ports information in the POP3 proxy and SMTP proxy sections. - - The POP3 proxy is then ready for your email client to connect to it on port - 110 and the SMTP proxy is ready for connections on port 25. You now need to - configure your email client to talk to the proxies instead of the real email - servers. Change your equivalent of "pop3.my-isp.com" to "localhost" (or to - the name of the machine you're running the proxy on) in your email client's - setup, and do the same with your equivalent of "smtp.my-isp.com". Hit "Get - new email" and look at the headers of the emails (send yourself an email if - you don't have any!) - there should be an X-Spambayes-Classification header - there. It probably says "unsure", if you haven't done any training yet. - You should be able to create a mail folder called "Suspected spam" and set - up a filtering rule that puts emails with an "X-Spambayes-Classification: - spam" heading into that folder. (Eventually we should publish instructions - on how to do this in all the popular email clients). - - How do I train Spambayes (web method)? -------------------------------------- --- 581,584 ---- *************** *** 767,774 **** ! How do I configure pop3proxy, imapfilter, etc. without a web browser? ! --------------------------------------------------------------------- ! You need to create a configuration file. This is in the 'standard' ini file format (originally created for Windows 3.1, I believe). You can find documentation on this format in the `ConfigParser docs`_, but basically, --- 725,757 ---- ! How do I configure Spambayes? ! ----------------------------- ! To configure the Outlook plugin, you should choose `SpamBayes Manager` from ! the `SpamBayes` button on the `SpamBayes` toolbar. ! ! If you use the POP3 proxy or IMAP filter, then simply open a browser ! window to http://localhost:8880, click on the configuration link on the top ! right of the page that opens up, and fill in the details. If you're using ! the POP3 proxy, you'll also need to configure your email client to talk to ! the proxies instead of the real email servers. Change your equivalent of ! `pop3.example.com` to `localhost` (or to the name of the machine you're ! running the proxy on) in your email client's setup, and do the same with ! your equivalent of `smtp.example.com". Hit "Get new email" and look at the ! headers of the emails (send yourself an email if you don't have any!) - ! there should be an X-Spambayes-Classification header there. It probably ! says "unsure", if you haven't done any training yet. You should be able to ! create a mail folder called "Suspected spam" and set up a filtering rule ! that puts emails with an "X-Spambayes-Classification: spam" heading into ! that folder. ! ! Otherwise, the system is configured through a file called ! `bayescustomize.ini` or `.spambayesrc`. In here you can configure the name ! and type of your database, your ham and spam cutoffs, and so on. The ! default values for all the options, and the documentation for them, lives ! in Options.py. ! ! To change an option, create a bayescustomize.ini and add the option to that ! - don't edit Options.py. This is in the 'standard' ini file format (originally created for Windows 3.1, I believe). You can find documentation on this format in the `ConfigParser docs`_, but basically, *************** *** 776,786 **** with a line like "[Section Name]", and options are set out within the appropriate section with lines like "opt = val" or "opt: val" (either is ! okay). Whitespace other than line endings is for the most part ignored, so you can make it look like whatever you like. You can see a list of what a configuration file of all the defaults would like like if you execute the ! following Python commands:: ! >>> from spambayes.Options import options ! >>> print options.display() .. _`ConfigParser docs`: http://www.python.org/doc/current/lib/module-ConfigParser.html --- 759,768 ---- with a line like "[Section Name]", and options are set out within the appropriate section with lines like "opt = val" or "opt: val" (either is ! ok). Whitespace other than line endings is for the most part ignored, so you can make it look like whatever you like. You can see a list of what a configuration file of all the defaults would like like if you execute the ! following Python command:: ! python -c "from spambayes.Options import options ; print options.display()" .. _`ConfigParser docs`: http://www.python.org/doc/current/lib/module-ConfigParser.html *************** *** 792,799 **** This depends on exactly what you want to do, and which application you are intending to use. The easiest thing is to execute the following Python ! commands:: ! >>> from spambayes.Options import options ! >>> print options.display_full() This will print out a complete list of the options, including a description --- 774,780 ---- This depends on exactly what you want to do, and which application you are intending to use. The easiest thing is to execute the following Python ! command:: ! python -c "from spambayes.Options import options ; print options.display_full()" This will print out a complete list of the options, including a description *************** *** 801,823 **** section, if you know its name:: ! >>> print options.display_full("section_name") Or just a single option:: ! >>> print options.display_full("section_name", "option_name") If you want a list of all the sections, you can use this command:: ! >>> print options.sections() If you want a list of all the options, you can use this command:: ! >>> print options.options(prepend_section_name=False) ! Why is Spambayes ignoring my configuration file? ------------------------------------------------ ! Spambayes looks for your configuration file in three places - if it can't find it, then, obviously, your options will not be loaded. The first place that Spambayes checks is the environment variable BAYESCUSTOMIZE. You can --- 782,804 ---- section, if you know its name:: ! python -c "from spambayes.Options import options ; print options.display_full('section_name')" Or just a single option:: ! python -c "from spambayes.Options import options ; print options.display_full('section_name', 'option_name')" If you want a list of all the sections, you can use this command:: ! python -c "from spambayes.Options import options ; print options.sections()" If you want a list of all the options, you can use this command:: ! python -c "from spambayes.Options import options ; print options.options(prepend_section_name=False)" ! Why is SpamBayes ignoring my configuration file? ------------------------------------------------ ! SpamBayes looks for your configuration file in three places - if it can't find it, then, obviously, your options will not be loaded. The first place that Spambayes checks is the environment variable BAYESCUSTOMIZE. You can *************** *** 827,831 **** method of specifying the location of the file, unless you do so via a user interface (as provided by the POP3 proxy, the Outlook plugin, and the IMAP ! filter). If Spambayes doesn't find anything in the BAYESCUSTOMIZE variable, then it checks the current working directory and your home directory for a bayescustomize.ini or .spambayesrc file (respectively). --- 808,812 ---- method of specifying the location of the file, unless you do so via a user interface (as provided by the POP3 proxy, the Outlook plugin, and the IMAP ! filter). If SpamBayes doesn't find anything in the BAYESCUSTOMIZE variable, then it checks the current working directory and your home directory for a bayescustomize.ini or .spambayesrc file (respectively). From mhammond at users.sourceforge.net Tue Aug 26 22:03:22 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 00:05:30 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs FolderSelector.py, 1.24, 1.25 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv2623 Modified Files: FolderSelector.py Log Message: Add some diagnostic code. This only currently kicks in when FolderSelector.py is run from the command line. Index: FolderSelector.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** FolderSelector.py 25 Aug 2003 06:30:27 -0000 1.24 --- FolderSelector.py 27 Aug 2003 04:03:20 -0000 1.25 *************** *** 11,14 **** --- 11,17 ---- import dlgutils + from pprint import pprint # debugging only + verbose = 0 + def INDEXTOSTATEIMAGEMASK(i): # from new commctrl.h return i << 12 *************** *** 72,75 **** --- 75,81 ---- PR_STORE_ENTRYID, PR_DISPLAY_NAME_A), None, order, 0) + if verbose: + print "Rows for sub-folder of", folder_spec.name, "-", folder_spec.folder_id + pprint(rows) for (eid_tag, eid),(storeeid_tag, store_eid), (name_tag, name) in rows: # Note the eid we get here is short-term - hence we must *************** *** 109,112 **** --- 115,121 ---- prop_tags = PR_ENTRYID, PR_DISPLAY_NAME_A rows = mapi.HrQueryAllRows(tab, prop_tags, None, None, 0) + if verbose: + print "message store rows:" + pprint(rows) for row in rows: (eid_tag, eid), (name_tag, name) = row *************** *** 123,132 **** ignore_eids = [item[1] for item in data[1:] if PROP_TYPE(item[0])==PT_BINARY] except pythoncom.com_error, details: ! # Some weird error opening a folder tree ! # Just print a warning and ignore the tree. ! print "Failed to open a folder for the FolderSelector dialog" ! print "Exception details:", details continue folder_id = hex_eid, mapi.HexFromBin(subtree_eid) spec = FolderSpec(folder_id, name, ignore_eids) spec.children = None --- 132,149 ---- ignore_eids = [item[1] for item in data[1:] if PROP_TYPE(item[0])==PT_BINARY] except pythoncom.com_error, details: ! # Handle 'expected' errors. ! if details[0]== mapi.MAPI_E_FAILONEPROVIDER: ! print "A message store is temporarily unavailable - " \ ! "it will not appear in the Folder Selector dialog" ! else: ! # Some weird error opening a folder tree ! # Just print a warning and ignore the tree. ! print "Failed to open a message store for the FolderSelector dialog" ! print "Exception details:", details continue folder_id = hex_eid, mapi.HexFromBin(subtree_eid) + if verbose: + print "message store root folder id is", folder_id + spec = FolderSpec(folder_id, name, ignore_eids) spec.children = None *************** *** 286,291 **** --- 303,312 ---- cItems, item_id)) + if verbose: + print "Inserting item", repr(insert_buf), "-", hitem = win32gui.SendMessage(self.list, commctrl.TVM_INSERTITEM, 0, insert_buf) + if verbose: + print "got back handle", hitem return hitem *************** *** 616,618 **** --- 637,640 ---- if __name__=='__main__': + verbose = 1 Test() From xenogeist at users.sourceforge.net Tue Aug 26 22:09:30 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Wed Aug 27 00:09:35 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs processors.py, 1.10, 1.11 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv3988/Outlook2000/dialogs Modified Files: processors.py Log Message: Cache bitmap handles. Index: processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/processors.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** processors.py 27 Aug 2003 02:11:38 -0000 1.10 --- processors.py 27 Aug 2003 04:09:28 -0000 1.11 *************** *** 10,13 **** --- 10,16 ---- from dlgutils import * + # Cache our leaky bitmap handles + bitmap_handles = {} + # A generic set of "ControlProcessors". A control processor by itself only # does a few basic things. *************** *** 52,66 **** text = win32gui.GetWindowText(self.GetControl()) name = rcp.names[int(text)] ! filename = rcp.bitmaps[name] ! import os, sys ! if hasattr(sys, "frozen"): ! # bitmap in the app/images directory ! filename = os.path.join(self.window.manager.application_directory, ! "images", filename) else: ! if not os.path.isabs(filename): ! filename = os.path.join( os.path.dirname( __file__ ), "resources", filename) ! handle = win32gui.LoadImage(0, filename, win32con.IMAGE_BITMAP,0,0, ! win32con.LR_COLOR|win32con.LR_LOADFROMFILE|win32con.LR_SHARED) win32gui.SendMessage(self.GetControl(), win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, handle) --- 55,73 ---- text = win32gui.GetWindowText(self.GetControl()) name = rcp.names[int(text)] ! if bitmap_handles.has_key(name): ! handle = bitmap_handles[name] else: ! filename = rcp.bitmaps[name] ! import os, sys ! if hasattr(sys, "frozen"): ! # bitmap in the app/images directory ! filename = os.path.join(self.window.manager.application_directory, ! "images", filename) ! else: ! if not os.path.isabs(filename): ! filename = os.path.join( os.path.dirname( __file__ ), "resources", filename) ! handle = win32gui.LoadImage(0, filename, win32con.IMAGE_BITMAP,0,0, ! win32con.LR_COLOR|win32con.LR_LOADFROMFILE|win32con.LR_SHARED) ! bitmap_handles[name] = handle win32gui.SendMessage(self.GetControl(), win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, handle) From mhammond at users.sourceforge.net Tue Aug 26 23:24:53 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 01:24:59 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.101,1.102 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv30473 Modified Files: addin.py Log Message: Avoid introducing a global named 'dir', and explicitly 'import encodings' so that the McMillan installer doesn't get upset. A binary with the new dialog system etc now works :) Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** addin.py 26 Aug 2003 13:37:49 -0000 1.101 --- addin.py 27 Aug 2003 05:24:51 -0000 1.102 *************** *** 5,8 **** --- 5,12 ---- import traceback + # *sigh* - this is for the binary installer, and for the sake of one line + # that is implicit anyway, I gave up + import encodings + try: True, False *************** *** 65,80 **** # hack together a simple logging strategy. if hasattr(sys, "frozen"): ! dir = win32api.GetTempPath() for i in range(3,0,-1): ! try: os.unlink(os.path.join(dir, "spambayes%d.log" % (i+1))) except os.error: pass try: os.rename( ! os.path.join(dir, "spambayes%d.log" % i), ! os.path.join(dir, "spambayes%d.log" % (i+1)) ) except os.error: pass # Open this log, as unbuffered so crashes still get written. ! sys.stdout = open(os.path.join(dir,"spambayes1.log"), "wt", 0) sys.stderr = sys.stdout else: --- 69,84 ---- # hack together a simple logging strategy. if hasattr(sys, "frozen"): ! temp_dir = win32api.GetTempPath() for i in range(3,0,-1): ! try: os.unlink(os.path.join(temp_dir, "spambayes%d.log" % (i+1))) except os.error: pass try: os.rename( ! os.path.join(temp_dir, "spambayes%d.log" % i), ! os.path.join(temp_dir, "spambayes%d.log" % (i+1)) ) except os.error: pass # Open this log, as unbuffered so crashes still get written. ! sys.stdout = open(os.path.join(temp_dir,"spambayes1.log"), "wt", 0) sys.stderr = sys.stdout else: From mhammond at users.sourceforge.net Tue Aug 26 23:30:07 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 01:30:12 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.29, 1.30 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv31180 Modified Files: dialog_map.py Log Message: Add a couple more full-stops, and remove the command prompt window when opening the log. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dialog_map.py 27 Aug 2003 00:07:07 -0000 1.29 --- dialog_map.py 27 Aug 2003 05:30:05 -0000 1.30 *************** *** 105,109 **** 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) --- 105,109 ---- 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) *************** *** 122,126 **** watch_names = manager.FormatFolderNames( config.watch_folder_ids, config.watch_include_sub) ! filter_status = "Watching '%s'. Spam managed in '%s', %s" \ % (watch_names, certain_spam_name, --- 122,126 ---- watch_names = manager.FormatFolderNames( config.watch_folder_ids, config.watch_include_sub) ! filter_status = "Watching '%s'. Spam managed in '%s', %s." \ % (watch_names, certain_spam_name, *************** *** 206,211 **** """Opens the log file for the current SpamBayes session """ ! import sys, os, win32api ! if 1 or hasattr(sys, "frozen"): # current log always "spambayes1.log" log_name = os.path.join(win32api.GetTempPath(), "spambayes1.log") --- 206,211 ---- """Opens the log file for the current SpamBayes session """ ! import sys, os, win32api, win32con ! if hasattr(sys, "frozen"): # current log always "spambayes1.log" log_name = os.path.join(win32api.GetTempPath(), "spambayes1.log") *************** *** 214,218 **** else: cmd = 'notepad.exe "%s"' % log_name ! os.system(cmd) else: question = "As you are running from source-code, viewing the\n" \ --- 214,218 ---- else: cmd = 'notepad.exe "%s"' % log_name ! win32api.WinExec(cmd, win32con.SW_SHOW) else: question = "As you are running from source-code, viewing the\n" \ From mhammond at users.sourceforge.net Wed Aug 27 00:53:30 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 02:53:35 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs FolderSelector.py, 1.25, 1.26 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv10136 Modified Files: FolderSelector.py Log Message: Ensure we only try and use tree items listed as valid by the mask. Hopefully will stop Tony's crash. Index: FolderSelector.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** FolderSelector.py 27 Aug 2003 04:03:20 -0000 1.25 --- FolderSelector.py 27 Aug 2003 06:53:27 -0000 1.26 *************** *** 196,205 **** item_textptr, item_cchText, item_image, item_selimage, \ item_cChildren, item_param = struct.unpack("10i", buffer) ! if item_textptr: text = win32gui.PyGetString(item_textptr) else: text = None - # Todo - translate items without the mask bit set to None return item_hItem, item_state, item_stateMask, \ text, item_image, item_selimage, \ --- 196,212 ---- item_textptr, item_cchText, item_image, item_selimage, \ item_cChildren, item_param = struct.unpack("10i", buffer) ! # ensure only items listed by the mask are valid ! if not (item_mask & commctrl.TVIF_TEXT): item_textptr = item_cchText = None ! if not (item_mask & commctrl.TVIF_CHILDREN): item_cChildren = None ! if not (item_mask & commctrl.TVIF_HANDLE): item_hItem = None ! if not (item_mask & commctrl.TVIF_IMAGE): item_image = None ! if not (item_mask & commctrl.TVIF_PARAM): item_param = None ! if not (item_mask & commctrl.TVIF_SELECTEDIMAGE): item_selimage = None ! if not (item_mask & commctrl.TVIF_STATE): item_state = item_stateMask = None ! if item_textptr: text = win32gui.PyGetString(item_textptr) else: text = None return item_hItem, item_state, item_stateMask, \ text, item_image, item_selimage, \ From mhammond at users.sourceforge.net Wed Aug 27 02:59:10 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 04:59:14 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.102,1.103 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv30308 Modified Files: addin.py Log Message: Tweak the toolbars: * Set OnAction for each item - this fixes: [ 776808 ] Expanding toolbar crashes outlook * All sub-items are now temporary. This should fix the problem of ordering sub-items between releases. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** addin.py 27 Aug 2003 05:24:51 -0000 1.102 --- addin.py 27 Aug 2003 08:59:07 -0000 1.103 *************** *** 666,670 **** # shows how to make a transparent bmp. # Also note that the clipboard takes ownership of the handle - ! # this, we can not simply perform this load once and reuse the image. if not os.path.isabs(fname): # images relative to the application path --- 666,670 ---- # shows how to make a transparent bmp. # Also note that the clipboard takes ownership of the handle - ! # thus, we can not simply perform this load once and reuse the image. if not os.path.isabs(fname): # images relative to the application path *************** *** 819,823 **** Visible=True, Tag=tag) ! def _AddControl(self, parent, # who the control is added to --- 819,823 ---- Visible=True, Tag=tag) ! def _AddControl(self, parent, # who the control is added to *************** *** 847,850 **** --- 847,862 ---- Type = control_type, Tag = tag) + # we only create top-level items as permanent, so we keep a little control + # over how they are ordered, especially between releases where the + # subitems are subject to change. This will prevent the user + # customising the dropdown items, but that is probably OK. + # (we could stay permanent and use the 'before' arg, but this + # is still pretty useless if the user has customized) + temporary = parent is not None + if item is not None and temporary: + # oops - we used to create them perm, but + item.Delete(False) + item = None + if item is None: if parent is None: *************** *** 882,886 **** # Now add the item itself to the parent. try: ! item = parent.Controls.Add(Type=control_type, Temporary=False) except pythoncom.com_error, e: # Toolbars seem to still fail randomly for some users. --- 894,898 ---- # Now add the item itself to the parent. try: ! item = parent.Controls.Add(Type=control_type, Temporary=temporary) except pythoncom.com_error, e: # Toolbars seem to still fail randomly for some users. *************** *** 896,899 **** --- 908,914 ---- for attr, val in item_attrs.items(): setattr(item, attr, val) + # didn't previously set this, and it seems to fix alot of problem - so + # we set it for every object, even existing ones. + item.OnAction = "" # Hook events for the item, but only if we haven't already in some From mhammond at users.sourceforge.net Wed Aug 27 03:06:19 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 05:06:23 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 README.txt,1.10,1.11 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv32549 Modified Files: README.txt Log Message: Add info how to unregister the source code version (which I could have sworn was already there :) Index: README.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/README.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** README.txt 18 Jun 2003 13:10:20 -0000 1.10 --- README.txt 27 Aug 2003 09:06:16 -0000 1.11 *************** *** 31,34 **** --- 31,39 ---- above) please send it to Mark. + To unregister the addin, execute "addin.py --unregister", then optionally + remove the source files. Note that as for the binary version, there is a + bug that the toolbar items will remain after an uninstall - see the + troubleshooting guide for information on how to restore it. + Filtering -------- From mhammond at users.sourceforge.net Wed Aug 27 05:28:06 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 07:28:10 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.103, 1.104 manager.py, 1.81, 1.82 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv21433 Modified Files: addin.py manager.py Log Message: Couple of bugs found by pychecker! Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** addin.py 27 Aug 2003 08:59:07 -0000 1.103 --- addin.py 27 Aug 2003 11:28:04 -0000 1.104 *************** *** 632,635 **** --- 632,636 ---- # that the source folder == dest folder - restore to # the inbox in this case. + subject = msgstore_message.GetSubject() restore_folder = msgstore_message.GetRememberedFolder() if restore_folder is None or \ *************** *** 639,643 **** # Must train before moving, else we lose the message! - subject = msgstore_message.GetSubject() print "Recovering to folder '%s' and ham training message '%s' - " % (restore_folder.name, subject), TrainAsHam(msgstore_message, self.manager) --- 640,643 ---- *************** *** 692,696 **** def SetupUI(self): manager = self.manager - activeExplorer = self assert self.toolbar is None, "Should not yet have a toolbar" --- 692,695 ---- Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** manager.py 26 Aug 2003 02:35:45 -0000 1.81 --- manager.py 27 Aug 2003 11:28:04 -0000 1.82 *************** *** 50,54 **** _DoMessage(message, title, win32con.MB_ICONEXCLAMATION) ! def ReportInformtation(message, title = None): if title is None: title = "SpamBayes" _DoMessage(message, title, win32con.MB_ICONINFORMATION) --- 50,54 ---- _DoMessage(message, title, win32con.MB_ICONEXCLAMATION) ! def ReportInformation(message, title = None): if title is None: title = "SpamBayes" _DoMessage(message, title, win32con.MB_ICONINFORMATION) From mhammond at users.sourceforge.net Wed Aug 27 05:28:49 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 07:28:53 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 train.py,1.32,1.33 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv21561 Modified Files: train.py Log Message: remove unused argument. Index: train.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/train.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** train.py 27 Aug 2003 03:34:40 -0000 1.32 --- train.py 27 Aug 2003 11:28:47 -0000 1.33 *************** *** 27,31 **** return cdata.message_db[msg.searchkey]=='1' ! def train_message(msg, is_spam, cdata, rescore=False): # Train an individual message. # Returns True if newly added (message will be correctly --- 27,31 ---- return cdata.message_db[msg.searchkey]=='1' ! def train_message(msg, is_spam, cdata): # Train an individual message. # Returns True if newly added (message will be correctly From mhammond at users.sourceforge.net Wed Aug 27 06:10:51 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 08:10:55 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.68,1.69 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv28015 Modified Files: msgstore.py Log Message: Don't bother getting PR_HAS_ATTACH as we don't use it, and fix bad function call detected by pychecker. Index: msgstore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** msgstore.py 26 Aug 2003 08:02:59 -0000 1.68 --- msgstore.py 27 Aug 2003 12:10:48 -0000 1.69 *************** *** 710,720 **** prop_ids = (PR_BODY_A, MYPR_BODY_HTML_A, - PR_HASATTACH, PR_TRANSPORT_MESSAGE_HEADERS_A) hr, data = self.mapi_object.GetProps(prop_ids,0) body = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0]) html = self._GetPotentiallyLargeStringProp(prop_ids[1], data[1]) ! has_attach = data[2][1] ! headers = self._GetPotentiallyLargeStringProp(prop_ids[3], data[3]) # Some Outlooks deliver a strange notion of headers, including --- 710,718 ---- prop_ids = (PR_BODY_A, MYPR_BODY_HTML_A, PR_TRANSPORT_MESSAGE_HEADERS_A) hr, data = self.mapi_object.GetProps(prop_ids,0) body = self._GetPotentiallyLargeStringProp(prop_ids[0], data[0]) html = self._GetPotentiallyLargeStringProp(prop_ids[1], data[1]) ! headers = self._GetPotentiallyLargeStringProp(prop_ids[2], data[2]) # Some Outlooks deliver a strange notion of headers, including *************** *** 947,951 **** if val == mapi.MAPI_E_NOT_ENOUGH_MEMORY: # Too big for simple properties - get via a stream ! return self._GetPropFromStream(prop) return None return val --- 945,949 ---- if val == mapi.MAPI_E_NOT_ENOUGH_MEMORY: # Too big for simple properties - get via a stream ! return GetPropFromStream(self.mapi_object, prop) return None return val From mhammond at users.sourceforge.net Wed Aug 27 06:31:49 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 08:31:53 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.104,1.105 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv31309 Modified Files: addin.py Log Message: pychecker: type and unused import. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** addin.py 27 Aug 2003 11:28:04 -0000 1.104 --- addin.py 27 Aug 2003 12:31:46 -0000 1.105 *************** *** 626,630 **** app.Session.GetDefaultFolder(constants.olFolderInbox)) new_msg_state = self.manager.config.general.recover_from_spam_message_state - import train for msgstore_message in msgstore_messages: # Recover where they were moved from --- 626,629 ---- *************** *** 1227,1231 **** else: new_hooks[msgstore_folder.id] = existing ! exiting.ReInit() return new_hooks --- 1226,1230 ---- else: new_hooks[msgstore_folder.id] = existing ! existing.ReInit() return new_hooks From mhammond at users.sourceforge.net Wed Aug 27 06:32:41 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 08:32:45 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.30, 1.31 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv31540 Modified Files: dialogs.rc Log Message: Remove '?' that looks a bit silly Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** dialogs.rc 27 Aug 2003 00:07:07 -0000 1.30 --- dialogs.rc 27 Aug 2003 12:32:39 -0000 1.31 *************** *** 49,53 **** WS_TABSTOP,16,100,217,10 PUSHBUTTON "Show Data Folder",IDC_SHOW_DATA_FOLDER,16,127,70,14 ! CONTROL "Enable background filtering?",IDC_BUT_TIMER_ENABLED, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,12,162,10 PUSHBUTTON "Diagnostics...",IDC_BUT_SHOW_DIAGNOSTICS,163,126,70,14 --- 49,53 ---- WS_TABSTOP,16,100,217,10 PUSHBUTTON "Show Data Folder",IDC_SHOW_DATA_FOLDER,16,127,70,14 ! CONTROL "Enable background filtering",IDC_BUT_TIMER_ENABLED, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,12,162,10 PUSHBUTTON "Diagnostics...",IDC_BUT_SHOW_DIAGNOSTICS,163,126,70,14 From mhammond at users.sourceforge.net Wed Aug 27 06:35:26 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 08:35:30 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/installer spambayes_addin.spec, 1.7, 1.8 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/installer In directory sc8-pr-cvs1:/tmp/cvs-serv32087 Modified Files: spambayes_addin.spec Log Message: Package up bitmaps and exclude win32ui from the binary. Index: spambayes_addin.spec =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/installer/spambayes_addin.spec,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** spambayes_addin.spec 4 Aug 2003 00:55:11 -0000 1.7 --- spambayes_addin.spec 27 Aug 2003 12:35:24 -0000 1.8 *************** *** 17,20 **** --- 17,24 ---- if os.path.isfile(fname): extras.append( ("images/"+basename(fname), abspath(fname), 'DATA') ) + # bitmaps for the dialog. + for fname in glob.glob(PROJECT_ROOT + "/dialogs/resources/*.bmp"): + if os.path.isfile(fname): + extras.append( ("images/"+basename(fname), abspath(fname), 'DATA') ) # docs extras.append( ("about.html", join(PROJECT_ROOT, "about.html"), 'DATA') ) *************** *** 29,33 **** extras.append( ("default_bayes_customize.ini", join(PROJECT_ROOT, "default_bayes_customize.ini"), 'DATA') ) ! excludes = ['dde', 'win32help'] mods = [] --- 33,37 ---- extras.append( ("default_bayes_customize.ini", join(PROJECT_ROOT, "default_bayes_customize.ini"), 'DATA') ) ! excludes = ['dde', 'win32help', 'pywin', 'win32ui'] mods = [] *************** *** 53,58 **** ('{AC0714F2-3D04-11D1-AE7D-00A0C90F26F4}', 0, 1, 0), ] dll = DLL(pyz, ! a.scripts, exclude_binaries=1, name='buildspambayes_addin/spambayes_addin.dll', --- 57,63 ---- ('{AC0714F2-3D04-11D1-AE7D-00A0C90F26F4}', 0, 1, 0), ] + extra_script_options = [] dll = DLL(pyz, ! a.scripts + extra_script_options, exclude_binaries=1, name='buildspambayes_addin/spambayes_addin.dll', From anadelonbrin at users.sourceforge.net Wed Aug 27 18:05:43 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Aug 27 20:05:46 2003 Subject: [Spambayes-checkins] website reply.txt,1.6,1.7 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1:/tmp/cvs-serv9265 Modified Files: reply.txt Log Message: Bring the auto-reply text up to date a bit, and emphise the FAQ. Index: reply.txt =================================================================== RCS file: /cvsroot/spambayes/website/reply.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** reply.txt 29 Jul 2003 02:17:58 -0000 1.6 --- reply.txt 28 Aug 2003 00:05:41 -0000 1.7 *************** *** 6,9 **** --- 6,18 ---- + Before you do anything else: + ---------------------------- + + Before asking a question on the list, please take a moment and check the + frequently asked questions page: + + http://spambayes.sourceforge.net/faq.html + + What is Spambayes? ------------------ *************** *** 11,19 **** The Spambayes project was formed to develop a Bayesian anti-spam filter, initially based on the work of Paul Graham. The major difference between ! this and other, similar projects is the emphasis on testing newer approaches to scoring messages. You can read all about Spambayes on the project's website: ! http://spambayes.sf.net/ --- 20,28 ---- The Spambayes project was formed to develop a Bayesian anti-spam filter, initially based on the work of Paul Graham. The major difference between ! this and other, similar, projects is the emphasis on testing newer approaches to scoring messages. You can read all about Spambayes on the project's website: ! http://spambayes.org/ *************** *** 29,41 **** ----------------------------------------------- ! There were problems installing the Outlook plug-in on some combinations of ! Windows and Outlook for early versions of the plug-in. Version 003 seems to ! install properly with all combinations of Windows and Outlook which have ! been tried so far. As of 2003-07-28, the most recent version is 006. If ! you are trying to install or run an earlier version, you should upgrade. ! More information about Spambayes and Windows can be found at ! http://spambayes.sf.net/windows.html --- 38,50 ---- ----------------------------------------------- ! Please ensure that you have the latest version. As of 2003-08-28, this is ! 007 for the Outlook plug-in, and 1.0a4 for everything else. If you are ! still having trouble, try looking at the bug reports that are currently ! open: ! http://sf.net/tracker/?group_id=61702&atid=498103 ! If you can't find anything, then else submit a bug (see below), or if you ! think it's just something you're doing wrong, ask the list. *************** *** 62,68 **** http://mail.python.org/mailman/listinfo/spambayes - - Before asking a question on the list, please take a moment and check the - frequently asked questions page: - - http://spambayes.sourceforge.net/faq.html --- 71,72 ---- From mhammond at users.sourceforge.net Wed Aug 27 18:16:51 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 20:16:55 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.31, 1.32 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv11291 Modified Files: dialogs.rc Log Message: Diagnostics dialog lost its caption! Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** dialogs.rc 27 Aug 2003 12:32:39 -0000 1.31 --- dialogs.rc 28 Aug 2003 00:16:49 -0000 1.32 *************** *** 121,124 **** --- 121,125 ---- WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP + CAPTION "Diagnostics" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN From mhammond at users.sourceforge.net Wed Aug 27 18:59:42 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 20:59:46 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.32, 1.33 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv19584 Modified Files: dialogs.rc Log Message: Diagnostics should use the same font as the rest Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** dialogs.rc 28 Aug 2003 00:16:49 -0000 1.32 --- dialogs.rc 28 Aug 2003 00:59:40 -0000 1.33 *************** *** 118,126 **** IDD_DIAGNOSTIC DIALOGEX 0, 0, 183, 98 ! STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | ! WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "Diagnostics" ! FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN LTEXT "These advanced options are for diagnostic or debugging purposes only. You should only change these options if specifically asked to, or you know exactly what they mean.", --- 118,125 ---- IDD_DIAGNOSTIC DIALOGEX 0, 0, 183, 98 ! STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_CONTEXTHELP CAPTION "Diagnostics" ! FONT 8, "Tahoma", 400, 0, 0x0 BEGIN LTEXT "These advanced options are for diagnostic or debugging purposes only. You should only change these options if specifically asked to, or you know exactly what they mean.", From mhammond at users.sourceforge.net Wed Aug 27 20:31:46 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Wed Aug 27 22:31:51 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.33, 1.34 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv2183 Modified Files: dialogs.rc Log Message: One combo was 2 dlg units shorter than the other :) Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** dialogs.rc 28 Aug 2003 00:59:40 -0000 1.33 --- dialogs.rc 28 Aug 2003 02:31:44 -0000 1.34 *************** *** 544,548 **** LTEXT "Clicking Delete as Spam should",IDC_STATIC,10,183,104, 10 ! COMBOBOX IDC_DEL_SPAM_RS,129,180,112,54,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END --- 544,548 ---- LTEXT "Clicking Delete as Spam should",IDC_STATIC,10,183,104, 10 ! COMBOBOX IDC_DEL_SPAM_RS,127,180,114,54,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END From anadelonbrin at users.sourceforge.net Thu Aug 28 02:57:00 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Aug 28 04:57:04 2003 Subject: [Spambayes-checkins] spambayes smtpproxy.py,1.11,1.12 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv22169 Modified Files: smtpproxy.py Log Message: Try a bit harder to proxy the exact command if we aren't going anything with it, and try to match it more closely even if we are. Index: smtpproxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/smtpproxy.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** smtpproxy.py 26 Aug 2003 06:49:56 -0000 1.11 --- smtpproxy.py 28 Aug 2003 08:56:57 -0000 1.12 *************** *** 208,214 **** # A proper command. if self.request[:10].upper() == "MAIL FROM:": ! splitCommand = self.request.strip().split(":", 1) elif self.request[:8].upper() == "RCPT TO:": ! splitCommand = self.request.strip().split(":", 1) else: splitCommand = self.request.strip().split(None, 1) --- 208,214 ---- # A proper command. if self.request[:10].upper() == "MAIL FROM:": ! splitCommand = self.request.split(":", 1) elif self.request[:8].upper() == "RCPT TO:": ! splitCommand = self.request.split(":", 1) else: splitCommand = self.request.strip().split(None, 1) *************** *** 230,233 **** --- 230,235 ---- if cooked is not None: self.serverSocket.push(cooked + '\r\n') + print "pulled: '%s'" % self.request + print "pushed: '%s'" % cooked self.command = self.args = self.request = '' *************** *** 349,356 **** else: self.blockData = False ! rv = command + ':' ! for arg in args: ! rv += ' ' + arg ! return rv def onData(self, command, args): --- 351,355 ---- else: self.blockData = False ! return "%s:%s" % (command, ' '.join(args)) def onData(self, command, args): *************** *** 371,376 **** def onUnknown(self, command, args): """Default handler.""" ! rv = "%s %s" % (command, ' '.join(args)) ! return rv --- 370,374 ---- def onUnknown(self, command, args): """Default handler.""" ! return self.request From richiehindle at users.sourceforge.net Thu Aug 28 15:15:13 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Thu Aug 28 17:15:17 2003 Subject: [Spambayes-checkins] spambayes/spambayes Options.py,1.67,1.68 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv25782 Modified Files: Options.py Log Message: Make it clear what the units of no_cache_large_messages are. Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Options.py 26 Aug 2003 05:40:53 -0000 1.67 --- Options.py 28 Aug 2003 21:15:06 -0000 1.68 *************** *** 741,748 **** ("no_cache_large_messages", "Maximum size of cached messages", 0, """Where message caching is enabled, this option suppresses caching ! of messages which are larger than this value. If you receive a lot ! of messages that include large attachments (and are correctly ! classified), you may not wish to cache these. If you set this to ! zero (0), then this option will have no effect.""", INTEGER, RESTORE), ), --- 741,748 ---- ("no_cache_large_messages", "Maximum size of cached messages", 0, """Where message caching is enabled, this option suppresses caching ! of messages which are larger than this value (measured in bytes). ! If you receive a lot of messages that include large attachments ! (and are correctly classified), you may not wish to cache these. ! If you set this to zero (0), then this option will have no effect.""", INTEGER, RESTORE), ), From richiehindle at users.sourceforge.net Thu Aug 28 15:17:31 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Thu Aug 28 17:17:36 2003 Subject: [Spambayes-checkins] spambayes/spambayes UserInterface.py, 1.18, 1.19 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv26359 Modified Files: UserInterface.py Log Message: Fixed the OE Mailbox code - the module is called oe_mailbox, not oe.mailbox. This is untested (he admits shamefacedly) - I'm not an OE user so I can't test it, but this bug was causing all through-the-web training to fail so I applied the obvious fix. Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** UserInterface.py 26 Aug 2003 04:30:41 -0000 1.18 --- UserInterface.py 28 Aug 2003 21:17:29 -0000 1.19 *************** *** 332,336 **** """Check if the uploaded mailbox file is an Outlook Express DBX one. ! In such a case we use the module oe.mailbox to convert the DBX content into a standard mbox file. When the file is not a DBX one, this method returns the original content. Testing if the file is a --- 332,336 ---- """Check if the uploaded mailbox file is an Outlook Express DBX one. ! In such a case we use the module oe_mailbox to convert the DBX content into a standard mbox file. When the file is not a DBX one, this method returns the original content. Testing if the file is a *************** *** 339,350 **** dbxStream = StringIO.StringIO(content) ! header = oe.mailbox.dbxFileHeader(dbxStream) if header.isValid() and header.isMessages(): ! file_info_len = oe.mailbox.dbxFileHeader.FH_FILE_INFO_LENGTH ! fh_entries = oe.mailbox.dbxFileHeader.FH_ENTRIES ! fh_ptr = oe.mailbox.dbxFileHeader.FH_TREE_ROOT_NODE_PTR ! info = oe.mailbox.dbxFileInfo(dbxStream, header.getEntry(file_info_len)) entries = header.getEntry(fh_entries) --- 339,350 ---- dbxStream = StringIO.StringIO(content) ! header = oe_mailbox.dbxFileHeader(dbxStream) if header.isValid() and header.isMessages(): ! file_info_len = oe_mailbox.dbxFileHeader.FH_FILE_INFO_LENGTH ! fh_entries = oe_mailbox.dbxFileHeader.FH_ENTRIES ! fh_ptr = oe_mailbox.dbxFileHeader.FH_TREE_ROOT_NODE_PTR ! info = oe_mailbox.dbxFileInfo(dbxStream, header.getEntry(file_info_len)) entries = header.getEntry(fh_entries) *************** *** 352,369 **** if address and entries: ! tree = oe.mailbox.dbxTree(dbxStream, address, entries) dbxBuffer = "" for i in range(entries): address = tree.getValue(i) ! messageInfo = oe.mailbox.dbxMessageInfo(dbxStream, address) if messageInfo.isIndexed(\ ! oe.mailbox.dbxMessageInfo.MI_MESSAGE_ADDRESS): ! address = oe.mailbox.dbxMessageInfo.MI_MESSAGE_ADDRESS messageAddress = \ messageInfo.getValueAsLong(address) ! message = oe.mailbox.dbxMessage(dbxStream, messageAddress) --- 352,369 ---- if address and entries: ! tree = oe_mailbox.dbxTree(dbxStream, address, entries) dbxBuffer = "" for i in range(entries): address = tree.getValue(i) ! messageInfo = oe_mailbox.dbxMessageInfo(dbxStream, address) if messageInfo.isIndexed(\ ! oe_mailbox.dbxMessageInfo.MI_MESSAGE_ADDRESS): ! address = oe_mailbox.dbxMessageInfo.MI_MESSAGE_ADDRESS messageAddress = \ messageInfo.getValueAsLong(address) ! message = oe_mailbox.dbxMessage(dbxStream, messageAddress) From richiehindle at users.sourceforge.net Thu Aug 28 15:20:11 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Thu Aug 28 17:20:21 2003 Subject: [Spambayes-checkins] spambayes/spambayes/resources ui.html, 1.17, 1.18 ui_html.py, 1.18, 1.19 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes/resources In directory sc8-pr-cvs1:/tmp/cvs-serv26949 Modified Files: ui.html ui_html.py Log Message: Added a missing '#' to the front of the header colour - this makes the web UI's headed boxes have pale yellow headers in strict browsers (eg. Mozilla), whereas the yellow colour only used to appear in non-strict browsers (eg. IE). Index: ui.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui.html,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ui.html 26 Aug 2003 04:30:41 -0000 1.17 --- ui.html 28 Aug 2003 21:20:08 -0000 1.18 *************** *** 25,29 **** .messagetable td { padding-left: 1ex; padding-right: 1ex } .sectiontable { border: 1px solid #808080; width: 95% } ! .sectionheading { background: fffae0; padding-left: 1ex; border-bottom: 1px solid #808080; font-weight: bold } --- 25,29 ---- .messagetable td { padding-left: 1ex; padding-right: 1ex } .sectiontable { border: 1px solid #808080; width: 95% } ! .sectionheading { background: #fffae0; padding-left: 1ex; border-bottom: 1px solid #808080; font-weight: bold } Index: ui_html.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui_html.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ui_html.py 26 Aug 2003 04:30:41 -0000 1.18 --- ui_html.py 28 Aug 2003 21:20:08 -0000 1.19 *************** *** 15,87 **** .dE0S\030\010\ ! _i\034EٲO\017Тf&һ`'jO\0272B\003O[\036ob:\004 y/\005,\020'e[\001\0201\001]#t\012\032\ ! ®4O#9{Xb\020F\023]^~eh\000dlp\032gy\034.\036S\\@x\ ! \007%=6\002olL3\006\\\034a5*\004۶.xrlZ=Z%\037Y\012_\015q9\ ! vvAz:\000:uO=\034Wc#?\0139L\002:\007zY(ga;Cg3&sy\006\014\003\025\007G\ ! ƣ\035)E2\004B\015\003#\004*+Q!]\005\012\022\0335k7~oN\ ! Q\006\011LgIG&r\"I`dI`*SB-9h:k\037\007\020CԌ_\ ! E`E@GяA\021`^\037-Bȣ\016}\014@}\000\015\003Ai:,\025WUM3E\033ȗ\ ! ӉO,\032V\011Z|9#(,C'\034\025\032J\033I4tK\016\007`u҄b\030v\ ! oGuuju\017\035\006cE\000~+EUąXdd!n B]1k6Q\030w\003\0354WPKmnu\ ! \002=\037m\ ! A?feUΰ^v\027@y0W\006N\014ӧJIg\016M=mȦ;1q;\020g\"]Sy%}\ ! \003\030\027iR\000(*^?\006ͶBe#PldCltPKǰ\006P\012\010ྻX\ ! 8aJ\00468 aXz E\011b|\011\037x\010\014\024^\006xĄ\037\0127s?bv\"\026\ ! \007eLce9XK7$DЍ?K \020\017Gq\001#\012{4$\005\034\030)\016L<\037\ ! J}E\000=?w\017!t7\027i+m\",.\013-ox<׋?ʴ%\ ! Lc\0363H\027ҔR>5+\027ɰJ!\037!\037%{ߌ\022!{~3S[deП~9\ ! uc{1t\014NY̦4L\000/vO*!g;\020?ǿpG԰O\033\\h=Үh6c'\ ! ޺\001ŗ(5x?&vNSԙ\035)Nމ\014~\011\022\001zE%\006+|5\037/\ ! 4\021)ˎhxzϻou\002\024񮫥\027\002{\014O'\024KRf\034\ ! m!f'\035٘9͘lF2\000+z[r*9\"\002\022\031L'1\010\000\\v| \ ! c먑&Z7P\002'Lt7PA'NdKLKr>X\001ik\034uwM\035\036SÛe\017\034\015\027rFyͯp\023\0136\"(,\026\000\ ! \020eor \025P]]\\*\"RWΩ2;\0012&\011jS:T/t)x\024KA%n'd{\ ! Ӱ\003EV#Ͷy\036L\031x?.\013\002!\005\023 a2$\ ! ̤(*\0358\023}^0x\025tgw\016hK\032҇\015x[\0370TvMOo>J1ΧI\ ! \0159ua\017K1fIx]a\035\005#S$ζFiT\\>tJPq\036\003VTҥf\ ! \025;HRb;l\007usc\012\037\020<+)(q8?\011\0266\010A_\020\ ! \015ծ ^0z\016n1}x\034֘=\026J%8Ov\0275@\011^+2Z\ ! lC\037t\011\000\007hu!SƶPVx\003うaJЋ\036 tY%_ƐhnuժP\ ! wH0x\014Z 2\016O_\\\025_\022<\003btr*T˛\005x\031}̒1\ ! }\020E8C`P?`kiN\027\017X\022\024Z`Ki\000KVC>pMAE?\ ! 8IE+x\013s\011_-j\032\022Po\023L\014\005\024aJ>\022*ݾ^*>\002~ӭ~\ ! Nu\037O{\006Ao{?|\027q\027ţ\023o\003:W퇫\026\001\021R\0245)NdA\ ! }MK6|lNeǹy2'v\\.o]8}\017\007\016\027W(\015`$G\004\036\ ! قVJ:\012]3H;7f$\026y\036\011e'}\005g\035ڍ99ļ\015@M\012N;\ ! NF\021I\016\0356\005\007\011\014:^_,\0120\032S\000jpΖW\017\035'6Ξ\ ! \036\001L:¬7q\010K\"*݂УF\037B0,Tu?ʛt\013t븫[\ ! \032~H:\033}V\025\005y\011r24K&^\006\035\"F.\015iD\023\026~O/@ﵤ߉w\002\ ! \034]\031軒\011`}'i;~{\014a&yĨYCX3u-Xͦ\0363 \010V\ ! 1&\017uK;DDLݍN]\0025\025^\023t\013\014VT\010\035w\025\000\0271\ ! =\0314W#\036\006\035=xt˳PDZ>\015,V=q\002<|_kCnh6\ ! \0172++xRˆRz}3\003k=r1\022نM@Jp[\033(Ay\ ! \001 Y\015gCxS\020\033\0159V[8\013\013FA}+lYVEf_ɊJ_\036\033+rt\016\ ! bȭ\025D=L|.Bv\022\027\035\007ad̩T>\031F\021\013\035F[n5\ ! b\021Z \003Zg3\ ! /4DlY\007PhQ3\023]\023'\013\031U-7t=\002Q8T\002cB`\"\ ! xoṫ\003[hkuʪx~z\001\004%C\022)3mΞYg[yy1\036\037\027\006\014\ ! ـ|%[\0114\\\001*@\010j#X\"CE+!\022MBB\031[\031ٷ\010E\001\ ! (oNQ\ ! \006\011LgI&r\"I`dY`*SB-9h:k\037\007\020CԌ_E`\ ! E@GяA\021`^\037-BH\016}\014@}\000\015\003Ai:,\025WUM3E\033ȗ۠\ ! O,\032V\011Z|9#(,C'\034\025\032J\033I4tK\016\007`u҄b\030voG\ ! uuju\017\035\006cE\000~+EUąXdd!n B]1k6Q\030w\003\0354WPKmnu\002\ ! =\037m\ ! A?feUΰ^v\027@y0W\006N\014ӧJIg\016M=mȦ;1q;\020g\"]Sy%}\003\ ! \030\027iR\000(*^?\006ͶBe#PldCltRKǰ\006P\012\010ྻX8\ ! aJ\00468 aXz E\011b|\011\037x\010\014\024^\006xĄ\037\0127s?bv\"\026\007e\ ! Lce9XK7$DЍ?K \020\017Gq\001#\012{4$\005\034\030)\016L<\037J}\ ! E\000=?w\017!t7\027i+m\",.\013-ox<׋?ʴ%Lc\ ! \0363H\027ҔR>5+\027ɰJ!\037!\037%{ߌ\022!{~3S[deП~9u\ ! c{1t\014NY̦4L\000/vO*!g;\020?ǿpG԰O\033\\h=Үh6c'޺\ ! \001ŗ(5x?&vNSԙ\035)Nމ\014~\011\022\001zE%\006+|5\037/4\ ! \021)ˎhxzϻou\002\024񮫥\027\002{\014'\024KRf\034m!\ ! f'\035٘9͘lF2\000+z[r*9\"\002\022\031L'1\010\000\\v| c\ ! 먑&Z7P\002'Lt7PA'NdKLKr>X\001ik\034uwM\035\036SÛe\017\034\015\027rFyͯp\023\0136\"(,\026\000\020\ ! eor \025P]]\\*\"RWΩ2;\0012&\011jS:T/t)x\024KA%n'd{Ӱ\ ! \003EV#Ͷy\036L\031x?.\013\002!\005\023 a2$\ ! ̤(*\0358\023}^0x\025tgw\016hK\032҇\015x[\0370TvMOo>J1ΧI\ ! \0159ua\017K1fIx]a\035\005#S$ζFiT\\>tJPq\036\003VTҥf\ ! \025;HRb;l\007usc\012\037\020<+)(q8?\011\0266\010A_\020\015\ ! ծ ^0z\016n1}x\034֘=\026J%8Ov\0275@\011^+2Zl\ ! C\037t\011\000\007hu!SƶPVx\003うaJЋ\036 tY%_ƐhnuժPw\ ! H0x\014Z 2\016O_\\\025_\022<\003btr*T˛\005x\031}̒1\ ! }\020E8C`P?`kiN\027\017X\022\024Z`Ki\000KVC>pMAE?\ ! 8IE+x\013s\011_-j\032\022Po\023L\014\005\024aJ>\022*ݾ^*>\002~ӭ~N\ ! u\037O{\006Ao{?|\027q\027ţ\023o\003:W퇫\026\001\021R\0245)NdA}\ ! MK6|lNeǹy2'v\\.o]8}\017\007\016\027W(\015`$G\004\036ق\ ! VJ:\012]3H;7f$\026y\036\011e'}\005g\035ڍ99ļ\015@M\012N;NF\ ! \021I\016\0356\005\007\011\014:^_,\0120\032S\000jpΖW\017\035'6Ξ\036\ ! \001L:¬7q\010K\"*݂УF\037B0,Tu?ʛt\013t븫[\ ! \032~H:\033}V\025\005}\011r24K&^\006\035\"F.\015iD\023\026~O/@ﵤ߉w\002\034]\ ! \031軒\011`}'i;~{\014a&yĨYCX3u-Xͦ\0363 \010V1&\ ! \017uK;DDLݍN]\0025\025^\023t\013\014VT\010\035w\025\000\0271=\ ! \0314W#\036\006\035=xt˳PDZ>\015,V=q\002<|_kCnh6\0172\ ! ++xRˆRz}3\003k=r1\022نM@Jp[\033(Ay\001\ ! Y\015gCxS\020\033\0159V[8\013\013FA}+lYVEf_ɊJ_\036\033+rt\016b\ ! \025D=L|.Bv\022\027\035\007ad̩T>\031F\021\013\035F[n5\ ! b\021Z Message-ID: <1ED4ECF91CDED24C8D012BCF2B034F130212ADAC@its-xchg4.massey.ac.nz> > Fixed the OE Mailbox code - the module is called oe_mailbox, > not oe.mailbox. This is untested (he admits shamefacedly) - > I'm not an OE user so I can't test it, but this bug was > causing all through-the-web training to fail so I applied the > obvious fix. Sorry, my bad again. I did all the testing in the configuration that Romain provided it in (i.e. a oe package with the mailbox module), and then when checking it in I change the import and forgot (foolishly) about the rest... Thanks once more Richie ;) =Tony Meyer From mhammond at users.sourceforge.net Thu Aug 28 18:08:46 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Aug 28 20:10:13 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 config_wizard.py, 1.6, 1.7 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv24480 Modified Files: config_wizard.py Log Message: If the user said in the Wizard they wanted to configure manually, we screwed up 2 things: * We created the folders and configured spambayes anyway! * But we didn't save anything, even what the user did from that dialog. Index: config_wizard.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/config_wizard.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** config_wizard.py 26 Aug 2003 08:12:20 -0000 1.6 --- config_wizard.py 29 Aug 2003 00:08:43 -0000 1.7 *************** *** 81,84 **** --- 81,91 ---- def CommitWizardConfig(manager, wc): + # If the user want to manually configure, then don't do anything + if wc.wizard.preparation == 2: # manually configure + import dialogs + dialogs.ShowDialog(0, manager, manager.config, "IDD_MANAGER") + manager.SaveConfig() + return + # Create the ham and spam folders, if necessary. manager.config.filter.watch_folder_ids = wc.filter.watch_folder_ids *************** *** 104,111 **** if wiz_cd: manager.classifier_data.Adopt(wiz_cd) ! if wc.wizard.preparation == 2: # manually configure ! import dialogs ! dialogs.ShowDialog(0, manager, manager.config, "IDD_MANAGER") ! elif wc.wizard.will_train_later: # User cancelled, but said they will sort their mail for us. # don't save the config - this will force the wizard up next time --- 111,115 ---- if wiz_cd: manager.classifier_data.Adopt(wiz_cd) ! if wc.wizard.will_train_later: # User cancelled, but said they will sort their mail for us. # don't save the config - this will force the wizard up next time From mhammond at users.sourceforge.net Thu Aug 28 18:10:35 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Aug 28 20:10:38 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 manager.py,1.82,1.83 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv24884 Modified Files: manager.py Log Message: Update our "verbose" variable from the config when saving it, so that changes made to the log level in the dialogs are reflected immediately. Move another "database not dirty" message from a print to a LogDebug Add a little more explanation to the "disabled reason" - specifically, tell them to use the 'Filtering' tab. Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** manager.py 27 Aug 2003 11:28:04 -0000 1.82 --- manager.py 29 Aug 2003 00:10:33 -0000 1.83 *************** *** 719,722 **** --- 719,724 ---- import locale; locale.setlocale(locale.LC_NUMERIC, "C") + # Update our runtime verbosity from the options. + self.verbose = self.config.general.verbose print "Saving configuration ->", self.config_filename.encode("mbcs", "replace") assert self.config and self.options, "Have no config to save!" *************** *** 734,738 **** self.classifier_data.Save() else: ! print "Bayes database is not dirty - not writing" def Close(self): --- 736,740 ---- self.classifier_data.Save() else: ! self.LogDebug(1, "Bayes database is not dirty - not writing") def Close(self): *************** *** 774,782 **** 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 = operator.truth(config.spam_folder_id) if not ok_to_enable: ! return "You must define the folder to receive your certain spam" return None --- 776,786 ---- ok_to_enable = operator.truth(config.watch_folder_ids) if not ok_to_enable: ! return "You must define folders to watch for new messages. " \ ! "Select the 'Filtering' tab to define these folders." ok_to_enable = operator.truth(config.spam_folder_id) if not ok_to_enable: ! return "You must define the folder to receive your certain spam. " \ ! "Select the 'Filtering' tab to define this folders." return None From mhammond at users.sourceforge.net Thu Aug 28 18:12:45 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Aug 28 20:12:50 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.30, 1.31 Message-ID: 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) From mhammond at users.sourceforge.net Thu Aug 28 18:38:57 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Aug 28 20:39:00 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.34, 1.35 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv29726 Modified Files: dialogs.rc Log Message: Fix the size of the radio buttons and the tab order on the Wizard welcome dialog. Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** dialogs.rc 28 Aug 2003 02:31:44 -0000 1.34 --- dialogs.rc 29 Aug 2003 00:38:54 -0000 1.35 *************** *** 155,159 **** LTEXT "Welcome to the SpamBayes configuration wizard", IDC_STATIC,20,4,191,14 - PUSHBUTTON "About...",IDC_BUT_ABOUT,215,104,60,15 LTEXT "This wizard will help you configure the SpamBayes Outlook addin. Please indicate how you have prepared for this application.", IDC_STATIC,20,20,255,18 --- 155,158 ---- *************** *** 163,172 **** CONTROL "I have already sorted good messages (ham) and spam messages into folders that are suitable for training purposes.", IDC_STATIC,"Button",BS_AUTORADIOBUTTON | BS_TOP | ! BS_MULTILINE,20,59,255,25 CONTROL "I would prefer to configure SpamBayes manually.", IDC_STATIC,"Button",BS_AUTORADIOBUTTON | BS_TOP,20,82, ! 187,14 LTEXT "If you would like more information about training and configuring SpamBayes, click the About button.", IDC_STATIC,20,103,185,20 LTEXT "If you cancel the wizard, you can access it again via the SpamBayes Manager, available from the SpamBayes toolbar.", IDC_STATIC,20,137,232,17 --- 162,172 ---- CONTROL "I have already sorted good messages (ham) and spam messages into folders that are suitable for training purposes.", IDC_STATIC,"Button",BS_AUTORADIOBUTTON | BS_TOP | ! BS_MULTILINE,20,59,255,18 CONTROL "I would prefer to configure SpamBayes manually.", IDC_STATIC,"Button",BS_AUTORADIOBUTTON | BS_TOP,20,82, ! 187,12 LTEXT "If you would like more information about training and configuring SpamBayes, click the About button.", IDC_STATIC,20,103,185,20 + PUSHBUTTON "About...",IDC_BUT_ABOUT,215,104,60,15 LTEXT "If you cancel the wizard, you can access it again via the SpamBayes Manager, available from the SpamBayes toolbar.", IDC_STATIC,20,137,232,17 From mhammond at users.sourceforge.net Fri Aug 29 00:15:18 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 29 02:15:22 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs/images sblogo.jpg, NONE, 1.1 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs/images In directory sc8-pr-cvs1:/tmp/cvs-serv8180 Added Files: sblogo.jpg Log Message: Logo for the docs. Feel free to change it :) --- NEW FILE: sblogo.jpg --- (This appears to be a binary file; contents omitted.) From mhammond at users.sourceforge.net Fri Aug 29 00:23:53 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 29 02:24:04 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources dialogs.rc, 1.35, 1.36 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv9346/resources Modified Files: dialogs.rc Log Message: Wizard "training is important" page goes to one of the new docs. Index: dialogs.rc =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/dialogs.rc,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** dialogs.rc 29 Aug 2003 00:38:54 -0000 1.35 --- dialogs.rc 29 Aug 2003 06:23:51 -0000 1.36 *************** *** 299,303 **** LTEXT "SpamBayes will not be effective until it is trained.", IDC_STATIC,11,8,191,14 ! PUSHBUTTON "About...",IDC_BUT_ABOUT,214,140,60,15 LTEXT "SpamBayes is a system that learns about good and bad mail based on examples you provide. It comes with no built-in rules, so must have some training information before it will be effective.", IDC_STATIC,11,21,263,30 --- 299,303 ---- LTEXT "SpamBayes will not be effective until it is trained.", IDC_STATIC,11,8,191,14 ! PUSHBUTTON "About Training...",IDC_BUT_ABOUT,209,140,65,15 LTEXT "SpamBayes is a system that learns about good and bad mail based on examples you provide. It comes with no built-in rules, so must have some training information before it will be effective.", IDC_STATIC,11,21,263,30 *************** *** 306,310 **** LTEXT "This option will close the wizard, and provide instructions how to sort your mail. You will then be able to configure SpamBayes and have it be immediately effective at filtering your mail", IDC_STATIC,22,106,252,27 ! LTEXT "For more information on training, click the About button.", IDC_STATIC,11,143,187,12 CONTROL "I want to continue without training, and let SpamBayes learn as it goes", --- 306,310 ---- LTEXT "This option will close the wizard, and provide instructions how to sort your mail. You will then be able to configure SpamBayes and have it be immediately effective at filtering your mail", IDC_STATIC,22,106,252,27 ! LTEXT "For more information, click the About Training button.", IDC_STATIC,11,143,187,12 CONTROL "I want to continue without training, and let SpamBayes learn as it goes", From mhammond at users.sourceforge.net Fri Aug 29 00:23:53 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 29 02:24:23 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.31, 1.32 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv9346 Modified Files: dialog_map.py Log Message: Wizard "training is important" page goes to one of the new docs. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** dialog_map.py 29 Aug 2003 00:12:43 -0000 1.31 --- dialog_map.py 29 Aug 2003 06:23:50 -0000 1.32 *************** *** 208,211 **** --- 208,214 ---- """Opens the SpamBayes documentation in a browser""" window.manager.ShowHtml("about.html") + def ShowTrainingDoc(window): + """Opens documentation on SpamBayes training in a browser""" + window.manager.ShowHtml("docs/welcome.html") def ShowDataFolder(window): """Uses Windows Explorer to show where SpamBayes data and configuration *************** *** 487,491 **** "IDD_WIZARD_TRAINING_IS_IMPORTANT" : ( (BoolButtonProcessor, "IDC_BUT_TRAIN IDC_BUT_UNTRAINED", "Wizard.will_train_later"), ! (CommandButtonProcessor, "IDC_BUT_ABOUT", ShowAbout, ()), ), "IDD_WIZARD_FOLDERS_REST": ( --- 490,494 ---- "IDD_WIZARD_TRAINING_IS_IMPORTANT" : ( (BoolButtonProcessor, "IDC_BUT_TRAIN IDC_BUT_UNTRAINED", "Wizard.will_train_later"), ! (CommandButtonProcessor, "IDC_BUT_ABOUT", ShowTrainingDoc, ()), ), "IDD_WIZARD_FOLDERS_REST": ( From mhammond at users.sourceforge.net Fri Aug 29 00:24:51 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 29 02:25:07 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs welcome.html, NONE, 1.1 troubleshooting.html, 1.13, 1.14 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs In directory sc8-pr-cvs1:/tmp/cvs-serv9463/docs Modified Files: troubleshooting.html Added Files: welcome.html Log Message: Re-structed the docs for the Outlook plugin to reflect the new wizard. --- NEW FILE: welcome.html --- Welcome To SpamBayes Logo

    Welcome to SpamBayes

    SpamBayes is an Outlook plugin that provides a spam filter based on statistical analysis of your personal mail.  Unlike many other spam detection systems, SpamBayes actually learns what you consider spam, and continually adapts as both your regular email and spam patterns change.

    When you first start Outlook after SpamBayes has been installed, the SpamBayes Installation Wizard will appear.  This Wizard will guide you through the configuration process and allow you to quickly have SpamBayes filtering your mail, howver this document contains additional information which will help make SpamBayes effective from the first time you use it.

    Please remember that this is free software; please be patient, and note that there are plenty of things to improve.  There are ways you can help, even if you aren't a programmer - you could help with this documentation, or make a donation, or any number of other ways - please see the main project page for information.  The list of Frequently Asked Questions may also answer some of yours.

    For more information on SpamBayes, including links to the rest of the documentation, see About SpamBayes.

    Training

    SpamBayes has no builtin rules, so anything you consider spam will be treated as spam by this system, even if it does not conform to the traditional definitions of spam.  This means that SpamBayes requires training before it will be effective.  There are two ways that this training can be done:
    • Allow SpamBayes to learn as it goes.  Initially, SpamBayes will consider all mail items unsure, and each item will be used to train.  In this scenario, SpamBayes will take some time to become effective.  It will rarely make mistakes, but will continue to be unsure about items until the training information grows.
    • Pre-sorting mail into two folders; one containing only examples of good messages, and another containing only examples of spam.  SpamBayes will then process all these messages gathering the clues it uses to filter mail..  Depending on how many messages you train on, SpamBayes will be immediately effective at correctly classifying your mail.

    The Installation Wizard will guide you through these options.

    It is important to note that even when SpamBayes has little training information, it rarely gets things wrong - the worst it generally does is to classify a message as unsure.  However, as mentioned, the more training information SpamBayes has, the less it is unsure about new messages.  See using the plugin below for more information.

    Using the Plugin

    This section describes how the plugin operates once it is configured.  You can access the SpamBayes features from the SpamBayes toolbar (shown to the right), but in general, SpamBayes will simply and silently filter your mail.

    SpamBayes Toolbar

    As messages arrive, they are given a spam score.  This score is the measure of how "spammy" the system has decided a mail is, with 100% being certain spam, and 0% meaning the message is certainly not spam.  The SpamBayes addin uses these scores to classify mail into one of three categories - certain spam, unsure, and good messages.  Good messages are often known in the anti-spam community as ham.

    Mail that is classified as good is never touched by this plugin - they will remain in your inbox, or be filtered normally by Outlook's builtin rules.  Mail that is classified as either unsure or certain spam is moved into different folders for future review.

    Outlook does not allow us to automatically add the spam score to your Outlook folder views - but you can do it manually by following these instructions.

    There are three ways in which the system can get things wrong:
    • A spam stays in your inbox.  This is known as a false negative.  In this case you can either drag the message to the Spam folder or click on the Delete as Spam button on the Outlook toolbar.  In both cases, the message will be trained as spam and will be moved to the spam folder.
    • Any message is moved to the unsure folder.  In this case, the system is simply unsure about the message, and moves it to the possible spam folder for human review.  All unsure messages should be manually classified; good messages can either be dragged back to the inbox, or have the Recover from Spam toolbar button clicked, while spam messages can either be dragged to the Spam folder or have the Delete as Spam toobar button (shown above) clicked.  In all cases, the system will automatically be trained appropriately.
    • A wanted (ham) message is moved to the Spam folder. This is known as a false positive. In this case you can either drag the message back to the folder from which it came (generally the inbox), or click on the Recover from Spam button.  In both cases the message will be trained as good, and moved back to the original folder.
    Note that in all cases, as you take corrective action on the mail, the system is also trained.  This makes it less likely that another similar mail will be incorrectly classified in the future.


    Index: troubleshooting.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/troubleshooting.html,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** troubleshooting.html 27 Jul 2003 11:15:22 -0000 1.13 --- troubleshooting.html 29 Aug 2003 06:24:48 -0000 1.14 *************** *** 12,18 **** the following problems listed:
    • Addin doesn't load
    • -
    • Addin loads, but no toolbar items can be - seen
    • Messages fail to filter
    • Messages have --- 12,18 ---- the following problems listed:
        +
      • Toolbar items appear, but fail to work
      • +
      • Addin loads with an error message
      • Addin doesn't load
      • Messages fail to filter
      • Messages have *************** *** 28,52 **** href="#mail">please read this first.

        Addin doesn't load

        ! When you start Outlook, there is no SpamBayes item in the ! toolbar, and no filtering occurs.  To resolve this:
        !
          !
        • Determine your ! installation type
          !
        • !
        • If you are running a binary version (ie, you downloaded a single ! installation program), then perform the following ! steps:
          --- 28,86 ---- href="#mail">please read this first.

          +

          Toolbar items appear, but fail to work

          + If the toolbar items fail to work, we are faciing one of two problems.
          +
            +
          • The addin has failed to load.  In this case, along with the + toolbars failing to work, SpamBayes will not be filtering or scoring + any messages.  To fix this, see the Addin + doesn't load instructions.
          • +
          +
            +
          • If the addin has loaded (ie, is filtering and scoring mail) but + the toolbar items don't, we have struck a common problem with the + toolbars.  Follow the instructions below.
            +
          • +
          + First we will try deleting the toolbar, and if that fails, completely + reset all Outlook toolbars.  Perform the following steps.
          +
            +
          • Right-click on any Outlook toolbar, and select Customize.
          • +
          • In the dialog that appears, locate SpamBayes in the list of + toolbars, and select it.
          • +
          • Click on the Delete button.  Outlook will ask for + confirmation that you want to delete the SpamBayes toolbar.  + Select OK.
          • +
          • Close the customize dialog.  The SpamBayes toolbar no longer + appear.
          • +
          • Restart Outlook.  SpamBayes will re-create the toolbar.
          • +
          + If all else fails, you can completely reset the Outlook toolbars by + removing the file \Documents and + Settings\{username}\Application Data\Microsoft\Outlook\outcmd.dat.  + Although this is undocumented by Microsoft, we have never heard reports + of problems.  If you are paranoid, simply rename this file so that + you have a copy.  This has solved all toolbar problems for + everyone who has reported one!
          +

          Addin loads with an error message

          + In this case, when you start Outlook you receive a message indicating + that SpamBayes could not be initialized.
          + This means that SpamBayes has loaded, but struck an error during + initialization.  If the information in the error message does not + indicate the nature of the error, please report + a bug (making sure you attach the log file)

          Addin doesn't load

          ! If you start Outlook but there was no error message, the SpamBayes ! toolbar items do not work and new messages have no Spam score or ! filtering applied, then the plugin has probably become disabled.
          • Check the log file.  If a log file for this session exists, then see if it contains an error.  If ! not, check the date and time of the log - it is probably a log from the ! last time it did work, so is no help to us.  If a log does exist, ! please report a bug.
            !
            !
          • Check that Outlook shows the addin as enabled.
            *************** *** 85,91 ****
          -
        • If you are running from source code, please re-register the - addin, as per the README.txt file.
        If none of that works, I am stumped! --- 119,126 ---- + If you are running from source code, the addin will not appear in the + above steps.  Please re-register the + addin, as per the README.txt file.
        If none of that works, I am stumped! *************** *** 94,138 **** -

        Addin loads, but no toolbar items can be - seen

        - If it appears the addin has loaded and is working correctly (ie, checking the log file indicates normal operation) - but you can not see any toolbar items for the addin, try the - following:.  -
          -
        • Make sure that you are displaying the 'SpamBayes' toolbar - - select - View -> Toolbars, and ensure that "SpamBayes" is selected.
          -
        • -
        • Try resetting the toolbars: -
            -
          1. Select View-> Toolbars-> Customize to display - the toolbar options dialog
          2. -
          3. Select the tab labelled Toolbars, - select the 'Standard' toolbar, - and click Reset
          4. -
          5. Restart Outlook
          6. -
          -
        • -
        • Try deleting the SpamBayes toolbar
        • -
            -
          1. Select View-> Toolbars-> Customize to display - the toolbar options dialog
          2. -
          3. Select the tab labelled Toolbars, - select the 'SpamBayes' toolbar, - and click Delete
          4. -
          5. Restart Outlook
            -
          6. -
          -
        - If all else fails, you can completely reset the Outlook toolbars by - removing the file \Documents and - Settings\{username}\Application Data\Microsoft\Outlook\outcmd.dat.  - Although this is undocumented by Microsoft, we have never heard reports - of problems - but you may like to make a copy of the file just in case.
        --- 129,132 ---- From mhammond at users.sourceforge.net Fri Aug 29 00:24:50 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 29 02:25:26 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 about.html,1.19,1.20 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv9463 Modified Files: about.html Log Message: Re-structed the docs for the Outlook plugin to reflect the new wizard. Index: about.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/about.html,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** about.html 10 Aug 2003 07:26:48 -0000 1.19 --- about.html 29 Aug 2003 06:24:48 -0000 1.20 *************** *** 5,189 ****

        SpamBayes Outlook Plugin

        ! Thank you for trying the SpamBayes anti-spam Outlook addin.  You ! can view this documentation at any time by starting Outlook, selecting ! the SpamBayes Manager option ! from the new SpamBayes toolbar ! you will see, and selecting the About ! button.
        !
        ! This plugin provides a spam filter based on statistical analysis of ! your personal mail.  Unlike other spam detection systems, ! SpamBayes ! actually learns what you consider spam, and continually adapts as both ! your regular email and spam patterns change.  There are no builtin ! rules, so anything you consider spam will be treated as spam by this ! system, even if it does not conform to the traditional definitions of ! spam.
        !
        ! Some time must be spent configuring the system, and performing initial ! training.  Once this has been completed, you will find the filter ! amazingly effective and making very few errors.
        !
        ! Bear in mind that this is an early version, and there are plenty of ! things to improve, particularly related to the initial configuration ! and ! training process.  Please bear with us, and see the troubleshooting guide should you ! have problems..  This is free software, so your help is needed - ! please see the main project ! page for information.
        !
        ! If you want a better picture of how the plugin actually operates, see using the plugin.  Also here you ! will find information on:
        ! ! If you would like to see some additional options you can set, please ! see the configuration guide.  ! If you have any problems, please see the troubleshooting guide.  You ! may also like to browse the Outlook ! section of the online SpamBayes Frequently Asked Questions (FAQ).
        !

        Using the plugin
        !

        ! As messages arrive, they are given a "spam score".  This score is ! the measure of how "spammy" the system has decided a mail is, with 100% ! being certain spam, and 0% meaning the message is certainly not ! spam.  The SpamBayes addin uses three different spam categories ! based on these scores to classify mail into one of three categories - ! certain spam, unsure, and good messages.  Good messages are often ! known in the anti-spam community as ham.
        ! Mail that is classified as good is never touched by this plugin - they ! will remain in your inbox, or be filtered normally by Outlook's builtin ! rules.  Mail that is classified as either unsure, or certain spam ! is moved into different folders for future review.
        ! There are three ways in which the system can get things wrong: !
          !
        • A spam stays in your inbox.  This is known as a false negative.  In this case ! you can either drag the message to the Spam folder or click on the Delete as Spam button on the ! Outlook ! toolbar.  In both cases, the message will be trained as spam and ! will be moved to the spam folder.
        • !
        • Any message is moved to the unsure folder.  In this case, ! the system is simply unsure about the message, and moves it to the ! possible spam folder for human review.  All unsure messages should ! be manually classified; good messages can either be dragged back to the ! inbox, or have the Recover from Spam ! toolbar button clicked, while spam messages can either be dragged to ! the ! Spam folder or have the Delete as ! Spam ! toobar button clicked.  In all cases, the system will ! automatically ! be trained appropriately.
        • !
        • A wanted (ham) message is moved to the Spam folder. This is known ! as a false positive. In ! this case you can either drag the message back to the folder from which ! it came (generally the inbox), or click on the Recover from Spam button.  In ! both cases the message will be trained as good, and moved back to the ! original folder.
        • !
        ! Note that in all cases, as you take corrective action on the mail, the ! system is also trained.  This makes it less likely that another ! similar mail will be incorrectly classified in the future.
        !
        !

        Installing and Configuring ! the plugin

        ! If you download the installer version of this plugin (ie, you ! downloaded a .EXE file you use to install), then everything is installed ! and just needs to be configured.  If you downloaded the sourcecode ! version of the plugin, please view README.txt for installation ! instructions.
        ! Configuring the plugin requires the following steps:

        ! ! ! ! ! ! ! !
        !
          !
        1. Confirm the plugin is installed:
          ! Start Outlook, select your Inbox, then look at your Outlook ! toolbar.  Just below the standard Toolbar, you should see a new ! toolbar with a SpamBayes ! dropdown button.  If this button appears, then the plugin is ! correctly installed and ready to use.  If the button does not ! appear, please see the ! troubleshooting guide.
        2. !
        3. Create ! Spam and Unsure folders
          ! Use the normal Outlook functions to create two new folders.  These ! can be named anything you like, and can appear anywhere in the folder ! hierarchy you choose - however, it is recommended you call them ! something like Spam and Possible Spam.
        4. !
        5. Manually create initial training data
          ! Go through your Inbox, Deleted Items ! and any other folders likely to have spam, and move as much as possible ! to the new Spam folder you just created.  Try and get as much Spam ! out of your inbox as possible, as your inbox will form the initial set ! of good messages we train on.  Don't worry too much about missing ! one or two spam - the system is likely to find them for you as we ! rescore your existing email.

          ! If your Inbox is so full of Spam you don't know where to start, you may ! like to create a temporary folder for the purposes of training your ! good messages.  Copy some examples of your good messages to this ! new folder (roughly the same number as Spam you are training on is ! best) and nominate this temporary folder instead of your Inbox.  ! Once trained, you can dispose of this folder.
        6. !
        7. Configure and Train SpamBayes
          ! Now we have our folders setup with some initial training data, we can ! configure the plugin.  From the SpamBayes ! button on the toolbar select SpamBayes ! Manager...  This will display the main dialog, as shown to ! the right.
        8. !
        9. Select Train Now, and the training dialog, also shown to ! the right will appear.  You will need to select your Inbox as the ! folder for good messages, and your new Spam folder as the source of ! junk messages.  Ensure that Score ! messages after training is selected, so we can see how effective ! our Inbox cleanup was.
        10. !
        11. Click on the Train Now button, and a progress indicator ! will be displayed as your messages are trained and scored.  When ! finished, close the training window to return ! to the SpamBayes window.
        12. !
        !
        SpamBayes Toolbar
        !
        The SpamBayes Toolbar
        !
        ! SpamBayes manager
        !
        The SpamBayes Manager dialog
        !
        !
        !
        !
        The training dialog
        !
        !
        !
        ! There are some additional options that can be set outside of the user ! interface - please see the configuration ! guide for more details.
        !

        Viewing and Using the Spam Score Field

        A custom property named Spam ! is added to all Outlook messages scored.  You can teach Outlook to display this field as a column in any table view, like the standard Messages view. --- 5,56 ---- + Logo

        SpamBayes Outlook Plugin

        !

        A spam filter based on statistical ! analysis of ! your personal mail.

        ! If you are new to SpamBayes, see Welcome ! To Spambayes.
        ! If you want to add the Spam field to your Outlook views, follow ! these instructions.
        ! If you need help configuring SpamBayes, see our Configuration Guide.
        ! If you are having problems with SpamBayes, please see the Troubleshooting Guide.
        !

        Other links of interest

        !

        The main SpamBayes project page.
        ! The online SpamBayes FAQ
        ! How to make a ! donation.
        !

        !

        Tips and Common Problems
        !

        !

        Filtering in the background: ! When Outlook is under load, SpamBayes may occasionally miss some ! messages (as Outlook doesn't tell us they appeared).  Also, if you ! use builtin Outlook rules, you may find that occasionally they fails to ! filter messages they normally would (as both SpamBayes and the builtin ! rules "fight" over processing the message).  Both of these ! problems can generally be solved by enabling background filtering of ! messages, via the SpamBayes Manager's Advanced ! tab.

        !

        Toobars stop working: Many ! people report that occasionally the toolbars will stop working.  ! See the troubleshooting guide ! for more details on how to fix this.

        !

        Toolbars remain after uninstall: ! If you uninstall SpamBayes, the toobar items will remain when you next ! start Outlook.  You can delete the toolbar by right-clicking on ! it, then selecting Customize.  Our troubleshooting guide has alot ! more information on toolbars.
        !

        !

        Viewing and Using the Spam Score Field

        A custom property named Spam ! is added to all Outlook messages scored, but Outlook does not allow us ! to automatically add this to your views.  However, you can teach ! Outlook to display this field as a column in any table view, like the standard Messages view. *************** *** 259,272 **** rules based on user-defined fields. That's why this addin supplies its own filtering rules.
        -

        Configuring the plugin for filtering

        - Once the system is trained and configured, you are ready to enable the - filtering capabilities.  From the SpamBayes manager, select Filters.  From this dialog you - can select all the folders that you wish to watch for spam.  You - also configure the folder where you want the certain spam and unsure - messages to be moved to.
        - Once this is done, you simply enable filtering from the main dialog, - and sit back and wait for spam!  See using - the plugin for further details.

        Your help is needed!

        This is free software.  Please offer any help you are able --- 126,129 ---- From mhammond at users.sourceforge.net Fri Aug 29 00:29:53 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 29 02:30:46 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs welcome.html, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs In directory sc8-pr-cvs1:/tmp/cvs-serv10130 Modified Files: welcome.html Log Message: typo Index: welcome.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/welcome.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** welcome.html 29 Aug 2003 06:24:48 -0000 1.1 --- welcome.html 29 Aug 2003 06:29:51 -0000 1.2 *************** *** 20,24 **** SpamBayes Installation Wizard will appear.  This Wizard will guide you through the configuration process and allow you to quickly have ! SpamBayes filtering your mail, howver this document contains additional information which will help make SpamBayes effective from the first time you use it.

        --- 20,24 ---- SpamBayes Installation Wizard will appear.  This Wizard will guide you through the configuration process and allow you to quickly have ! SpamBayes filtering your mail.  This document contains additional information which will help make SpamBayes effective from the first time you use it.

        From mhammond at users.sourceforge.net Fri Aug 29 08:41:36 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 29 10:44:11 2003 Subject: [Spambayes-checkins] spambayes/windows/py2exe - New directory Message-ID: Update of /cvsroot/spambayes/spambayes/windows/py2exe In directory sc8-pr-cvs1:/tmp/cvs-serv23660/py2exe Log Message: Directory /cvsroot/spambayes/spambayes/windows/py2exe added to the repository From xenogeist at users.sourceforge.net Fri Aug 29 08:42:38 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Fri Aug 29 10:44:25 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs welcome.html, 1.2, 1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs In directory sc8-pr-cvs1:/tmp/cvs-serv23849/Outlook2000/docs Modified Files: welcome.html Log Message: Use relative path for logo image Index: welcome.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/welcome.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** welcome.html 29 Aug 2003 06:29:51 -0000 1.2 --- welcome.html 29 Aug 2003 14:42:36 -0000 1.3 *************** *** 7,11 **** ! Logo

        Welcome to SpamBayes
        --- 7,11 ---- ! Logo

        Welcome to SpamBayes
        From mhammond at users.sourceforge.net Fri Aug 29 08:46:21 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 29 10:46:25 2003 Subject: [Spambayes-checkins] spambayes/windows/py2exe README.txt,NONE,1.1 Message-ID: Update of /cvsroot/spambayes/spambayes/windows/py2exe In directory sc8-pr-cvs1:/tmp/cvs-serv24745 Added Files: README.txt Log Message: readme, please readme. --- NEW FILE: README.txt --- This is a py2exe setup script. Grab the CVS version of py2exe from sourceforge. Ensure you have Python 2.3. Install the py2exe\sandbox version, *not* the top-level py2exe version. Run "setup_all.py" You should find a dist directly. pop3proxy*.exe should all work. addin.exe/addin.dll are the Outlook addin and do not work (and will be renamed) From xenogeist at users.sourceforge.net Fri Aug 29 08:48:33 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Fri Aug 29 10:48:36 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs/resources sblogo.bmp, 1.2, 1.3 sbwizlogo.bmp, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources In directory sc8-pr-cvs1:/tmp/cvs-serv25381/Outlook2000/dialogs/resources Modified Files: sblogo.bmp sbwizlogo.bmp Log Message: 256 color versions on the logos Index: sblogo.bmp =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/sblogo.bmp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsAmmyms and /tmp/cvsa2s36J differ Index: sbwizlogo.bmp =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/resources/sbwizlogo.bmp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs5c2B4s and /tmp/cvsImYvQN differ From mhammond at users.sourceforge.net Fri Aug 29 08:44:10 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Aug 29 10:51:33 2003 Subject: [Spambayes-checkins] spambayes/windows/py2exe setup_all.py, NONE, 1.1 Message-ID: Update of /cvsroot/spambayes/spambayes/windows/py2exe In directory sc8-pr-cvs1:/tmp/cvs-serv24115 Added Files: setup_all.py Log Message: First cut at a py2exe setup script. --- NEW FILE: setup_all.py --- # setup_all.py # A distutils setup script for SpamBayes binaries import sys, os sb_top_dir = os.path.abspath(os.path.dirname(os.path.join(__file__, "../../../.."))) try: import classifier except ImportError: sys.path.append(sb_top_dir) try: import pop3proxy_service except ImportError: sys.path.append(os.path.join(sb_top_dir, "windows")) try: import addin except ImportError: sys.path.append(os.path.join(sb_top_dir, "Outlook2000")) # ModuleFinder can't handle runtime changes to __path__, but win32com uses them, # particularly for people who build from sources. Hook this in. try: import modulefinder import win32com for p in win32com.__path__[1:]: modulefinder.AddPackagePath("win32com", p) # Not sure why this works for "win32com.mapi" for not "win32com.shell"! for extra in ["win32com.shell"]: __import__(extra) m = sys.modules[extra] for p in m.__path__[1:]: modulefinder.AddPackagePath(extra, p) except ImportError: # no build path setup, no worries. pass from distutils.core import setup import py2exe class py2exe_options: bitmap_resources = [(1000, os.path.join(sb_top_dir, r"Outlook2000\dialogs\resources\sblogo.bmp"))] packages = "spambayes.resources" excludes = "win32ui,pywin" # pywin is a package, and still seems to be included. # Default and only distutils command is "py2exe" - save adding it to the # command line every single time. if len(sys.argv)==1: sys.argv = [sys.argv[0], "py2exe"] setup(name="SpamBayes", packages = ["spambayes.resources"], # We implement a COM object. com_server=["addin"], # A service service=["pop3proxy_service"], # A console exe for debugging console=[os.path.join(sb_top_dir, "pop3proxy.py")], ) From xenogeist at users.sourceforge.net Fri Aug 29 09:18:25 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Fri Aug 29 11:18:29 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs welcome.html, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs In directory sc8-pr-cvs1:/tmp/cvs-serv31038/Outlook2000/docs Modified Files: welcome.html Log Message: Make the doc logos more of a bar. Index: welcome.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/welcome.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** welcome.html 29 Aug 2003 14:42:36 -0000 1.3 --- welcome.html 29 Aug 2003 15:18:22 -0000 1.4 *************** *** 7,12 **** ! Logo

        Welcome to SpamBayes

        --- 7,16 ---- ! ! ! ! !
        Logo 

        Welcome to SpamBayes

        From xenogeist at users.sourceforge.net Fri Aug 29 09:18:24 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Fri Aug 29 11:18:41 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs/images python.jpg, NONE, 1.1 span.jpg, NONE, 1.1 sblogo.jpg, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs/images In directory sc8-pr-cvs1:/tmp/cvs-serv31038/Outlook2000/docs/images Modified Files: sblogo.jpg Added Files: python.jpg span.jpg Log Message: Make the doc logos more of a bar. --- NEW FILE: python.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: span.jpg --- (This appears to be a binary file; contents omitted.) Index: sblogo.jpg =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/images/sblogo.jpg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsVwab0d and /tmp/cvs0NM1Gh differ From xenogeist at users.sourceforge.net Fri Aug 29 09:18:24 2003 From: xenogeist at users.sourceforge.net (Adam Walker) Date: Fri Aug 29 11:18:54 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 about.html,1.20,1.21 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv31038/Outlook2000 Modified Files: about.html Log Message: Make the doc logos more of a bar. Index: about.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/about.html,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** about.html 29 Aug 2003 06:24:48 -0000 1.20 --- about.html 29 Aug 2003 15:18:22 -0000 1.21 *************** *** 5,10 **** ! Logo

        SpamBayes Outlook Plugin

        A spam filter based on statistical --- 5,14 ---- ! ! ! ! !
        Logo 

        SpamBayes Outlook Plugin

        A spam filter based on statistical From anadelonbrin at users.sourceforge.net Sat Aug 30 01:03:27 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sat Aug 30 03:03:37 2003 Subject: [Spambayes-checkins] spambayes CHANGELOG.txt,1.11,1.12 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv24107 Modified Files: CHANGELOG.txt Log Message: Phew. Bring this up to date in preparation for 1.0a5. There were a *lot* of check-ins in getting the new Outlook plug-in system up and running. I've been pretty picky about what I have included in the changelog - if Mark or Adam think something is missing (and can be bothered reading the changelog ) then they can add them :) Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/CHANGELOG.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CHANGELOG.txt 25 Aug 2003 23:59:38 -0000 1.11 --- CHANGELOG.txt 30 Aug 2003 07:03:25 -0000 1.12 *************** *** 1,7 **** ! (Next Release) ! ============== Richie Hindle 26/08/2003 Fix [ 743131 ] Specifying a POP3 server on the pop3proxy command line but no local port number (ie. no -l) now works again, defaulting to local port 110. Tony Meyer 19/08/2003 Allow @ and = in paths. Mark Hammond 18/08/2003 Improve the starting/stopping of the pop3proxy service Tony Meyer 18/08/2003 Allow the pop3proxy_service to start smtpproxy as well Tony Meyer 18/08/2003 Add version information to the web interface, as requested in [ spambayes-Bugs-790051 ] Can't review messages if probability header is turned on --- 1,50 ---- ! Alpha Release 5 ! =============== ! Richie Hindle 29/08/2003 Fix the yellow colour of the header boxes in the web interface in strict browers (i.e. not IE ;) ! Tony Meyer 28/08/2003 smtproxy: try a bit harder to proxy the exact command if we aren't going anything with it, and try to match it more closely even if we are. ! Mark Hammond 27/08/2003 Outlook: all menu sub-items are now temporary. ! Mark Hammond 27/08/2003 Fix [ 776808 ] Expanding toolbar crashes outlook ! Mark Hammond 27/08/2003 Outlook: ensure we only try and use tree items listed as valid by the mask. ! Mark Hammond 27/08/2003 Fix [ 795749 ] "Score after training" doesn't in CVS ! Mark Hammond 27/08/2003 Outlook: add 'View Log' button to the Diagnostics dialog. ! Tony Meyer 26/08/2003 Fix restoring defaults from the web interface. ! Tony Meyer 26/08/2003 Implement [ 791254 ] Advanced configuration panel. ! Tony Meyer 26/08/2003 smtpproxy: don't convert unknown commands to upper case as this mucks about with passwords, which might be case sensitive. ! Richie Hindle 26/08/2003 Fixed [ 787251 ] Problem refreshing message list and [ 790051 ] Can't review messages. ! Richie Hindle 26/08/2003 Added a missing line break in the status pane on the Home page when there are no proxies configured. Richie Hindle 26/08/2003 Fix [ 743131 ] Specifying a POP3 server on the pop3proxy command line but no local port number (ie. no -l) now works again, defaulting to local port 110. + Skip Montanaro 26/08/2003 Change the storage.py print statements to print to stderr, so that using verbose=True is possible using apps that work through stdin. + Mark Hammond 26/08/2003 Fix [ 779319 ] ntpath Unicode error + Mark Hammond 26/08/2003 Outlook: default folder names used by the Wizard are now "Junk E-Mail" and "Junk Suspects" + Mark Hammond 26/08/2003 Outlook: the experimental 'timers' options got upgraded to the 'filter' section. + Adam Walker 26/08/2003 Outlook: added button on advanced tab to display the spambayes data folder. + Adam Walker 26/08/2003 Outlook: move Filter Now to a seperate dialog invoked by the drop down menu on the toolbar. + Tony Meyer 25/08/2003 Fix some old option names. + Tony Meyer 25/08/2003 Change the notate_to and notate_subject options to notate for spam, unsure, ham, or any combination (including none) thereof. + Tony Meyer 25/08/2003 Add no_cache_large_messages option. If messages are bigger than this, don't cache them (to avoid caching messages with massive attachments that are already correctly classified). + Tony Meyer 25/08/2003 Add an open_storage function to centralise opening storage, which also works with the new SQL classifiers. Used by pop3proxy and hammiefilter at the moment. + Tony Meyer 25/08/2003 smtpproxy should now work as previously, but also training on the exact message sent, rather than looking up via id. Lookup into the imapfilter folders is also possible. + Mark Hammond 25/08/2003 Fix [ 785389 ] Folders missing in Spambayes manager. + Mark Hammond 25/08/2003 Fix [ 786952 ] Error when profile name has invalid filename characters. + Mark Hammond 25/08/2003 Outlook: We now work with "IPM.Note" and "IPM.Anti-Virus*" + Mark Hammond 25/08/2003 Outlook: Fail when we can't find a default message store. + Mark Hammond 25/08/2003 Fix "[ 788495 ] Filter fails when folder full" + Mark Hammond 25/08/2003 Outlook: remove last win32ui dialog. + Mark Hammond 25/08/2003 Outlook: change default filter action to "move" + Mark Hammond 25/08/2003 Outlook: don't score if the training was cancelled. + Mark Hammond 25/08/2003 Outlook: present the wizard when required. + Mark Hammond 25/08/2003 Outlook: allow filtering to be enabled, even if no training information! + Tony Meyer 23/08/2003 Add [ 789916 ]. Outlook Express .dbx files can now be used to train, just like mbox files. + Mark Hammond 23/08/2003 Outlook: we can cancel a train without destroying the DB, and mail that comes in during the training will not use the partial db. + Mark Hammond 23/08/2003 An empty 'allowed values' now allows an empty string. + Mark Hammond 23/08/2003 Outlook: add a "New Folder" button to the folder selector dialog. + Mark Hammond 20/08/2003 Outlook: add wizard dialogs. + Tony Meyer 19/08/2003 Implement [ 790615 ] Allowed remote connections management, which addresses [ 698036 ] pop3proxy security Tony Meyer 19/08/2003 Allow @ and = in paths. + Adam Walker 19/08/2003 Outlook: add a Wizard framework. + Adam Walker 19/08/2003 Outlook: add a diagnostic dialog. + Adam Walker 18/08/2003 Fix [ 790406 ] Allow the timers to be set in half second increments. Mark Hammond 18/08/2003 Improve the starting/stopping of the pop3proxy service + Adam Walker 18/08/2003 Outlook: change the manager dialog to a tabbed interface, and add a logo to it. Tony Meyer 18/08/2003 Allow the pop3proxy_service to start smtpproxy as well Tony Meyer 18/08/2003 Add version information to the web interface, as requested in [ spambayes-Bugs-790051 ] Can't review messages if probability header is turned on *************** *** 15,18 **** --- 58,66 ---- Tony Meyer 12/08/2003 Web interface: At some point (before the 1.0a4 release) selecting both "header" and "body" stopped working. This fixes that. Tony Meyer 12/08/2003 Have the review messages page put the unsure messages at the top, because they are the most important to take action on + Mark Hammond 11/08/2003 Outlook: SpamClues shows the percentage as well as the raw score. + Adam Walker 09/08/2003 Outlook: Added website links to the help menu. + Adam Walker 09/08/2003 Use the Tahoma font in the Outlook dialogs. + Mark Hammond 09/08/2003 Fix [ 780612 ] Outlook incorrectly trains on moves messages. + Mark Hammond 08/08/2003 Fix bug [ 784323 ] Plug-in will not intialize/watch in offline mode Tony Meyer 07/08/2003 Add a mySQLClassifier class Skip Montanaro 07/08/2003 Add a postgreSQL classifier class, and a base SQLClassifier class *************** *** 20,31 **** Skip Montanaro 07/08/2003 Remove dumbdbm from the possible dbm storage options Tony Meyer 07/08/2003 Fix [ 784296 ] imapfilter broken with Python 2.3 Mark Hammond 04/08/2003 Add a get_option method, so an option instance itself can be fetched. ! Mark Hammond 29/07/2003 Version.py: Indicate the generated output is generated :) Make work for Python 2.2, but don't trust its config parser for remote data. Mark Hammond 29/07/2003 Support fetching the "latest" set of version data from the spambayes web site. Richie Hindle 28/07/2003 Made the pop3proxy work with fetchmail. Tim Peters 25/07/2003 Fix SF bug 777026: Possible cause for db corruption in DBDictClassifier. Mark Hammond 25/07/2003 Created a directory & readme for test suites, including a storage.py test. Tony Meyer 25/07/2003 [ 777165 ] Typo in Options.py causes bogus warning on reading config Richie Hindle 22/07/2003 You can once again specify local addresses as well as ports for the pop3proxy to listen on (was broken in 1.0a3 and 1.0a4). Mark Hammond 20/07/2003 pop3proxy_service: log exceptions if the server thread dies unexpectedly. Mark Hammond 20/07/2003 Fix [ 761499 ] pop3proxy_service doesn't stop when shutdown from browser. --- 68,105 ---- Skip Montanaro 07/08/2003 Remove dumbdbm from the possible dbm storage options Tony Meyer 07/08/2003 Fix [ 784296 ] imapfilter broken with Python 2.3 + Adam Walker 06/08/2003 Outlook: move the html menu options to a Help sub-menu. + Mark Hammond 06/08/2003 Fix [ 780819 ] Images pasted to clipboard each startup Mark Hammond 04/08/2003 Add a get_option method, so an option instance itself can be fetched. ! Mark Hammond 04/08/2003 Outlook: new data driven dialogs loaded from Windows .rc scripts. ! Mark Hammond 04/08/2003 Outlook: add a resource script parser, by Adam Walker. ! Mark Hammond 01/08/2003 Outlook: fix [ 780801 ] IMAP Still Failing - GetField() returns None on MAPI error ! Mark Hammond 30/07/2003 Outlook: avoid passing a float to C functions that take an int (the slider pos) ! Mark Hammond 29/07/2003 Fix [ 779049 ] email.Errors.HeaderParseError: Continuation line seen ... ! Mark Hammond 29/07/2003 Outlook: change the way we detect 'unsent' items - this way catches both unsent items, and copies of sent items. ! Mark Hammond 29/07/2003 Outlook: add ability to check for the latest version. ! Mark Hammond 29/07/2003 Version.py: indicate the generated output is generated :) Make work for Python 2.2, but don't trust its config parser for remote data. Mark Hammond 29/07/2003 Support fetching the "latest" set of version data from the spambayes web site. Richie Hindle 28/07/2003 Made the pop3proxy work with fetchmail. + Mark Hammond 28/07/2003 Outlook: Add a new experimental 'timer'. + Mark Hammond 26/07/2003 Outlook: Log the binary version in the binary. + Mark Hammond 25/07/2003 Fix locale issues in Outlook - fixes [ 765912 ] AssertionError: Proportions must add to 1.0 ... Tim Peters 25/07/2003 Fix SF bug 777026: Possible cause for db corruption in DBDictClassifier. Mark Hammond 25/07/2003 Created a directory & readme for test suites, including a storage.py test. Tony Meyer 25/07/2003 [ 777165 ] Typo in Options.py causes bogus warning on reading config + Mark Hammond 23/07/2003 Outlook: fix a bug in how attachment properties were fetched - if the body was "large", we attempted to get the "large property" from the mail object itself, rather than the attachment. + Mark Hammond 23/07/2003 Outlook: fix a problem where multipart/signed messages could still screw us. + Mark Hammond 23/07/2003 Fix [ 693387 ] user-composed messages are filtered. + Mark Hammond 23/07/2003 Outlook: Check the message flag for the "unsent" bit. Richie Hindle 22/07/2003 You can once again specify local addresses as well as ports for the pop3proxy to listen on (was broken in 1.0a3 and 1.0a4). + Mark Hammond 21/07/2003 Outlook: Paul Moore reports that not specifying USER_DEFERRED_ERRORS solves his "unread flag" issue - and we certainly don't need that flag here, so out it goes. + Mark Hammond 21/07/2003 Outlook: While we are printing versions, Python gets a go. + Mark Hammond 21/07/2003 Fix 690418: Non mail items filtered by Outlook + Mark Hammond 21/07/2003 Fix 719586: Cannot View Spam Cues for Undeliverable Reports + Mark Hammond 21/07/2003 Outlook: Add IsFilterCandidate() method to a message object to determine if this is a message we should try and filter. + Mark Hammond 21/07/2003 Outlook: Rationalize code that creates a message object. + Mark Hammond 21/07/2003 Outlook: Ignore errors when enumerating stores. + Mark Hammond 21/07/2003 Outlook: Work better with a unicode data directory. + Mark Hammond 21/07/2003 Outlook: Add a new filter option - "save_spam_info", default=True. + Mark Hammond 20/07/2003 Fix [ 769346 ] Problems after deleting certain spam folder as implemented in [ 769981 ] Outlook plugin: allow user to change spam and unsure. Mark Hammond 20/07/2003 pop3proxy_service: log exceptions if the server thread dies unexpectedly. Mark Hammond 20/07/2003 Fix [ 761499 ] pop3proxy_service doesn't stop when shutdown from browser. *************** *** 33,38 **** --- 107,116 ---- Mark Hammond 19/07/2003 pop3proxy_service: Redirect output to win32traceutil (for want of a better place) Richie Hindle 19/07/2003 pop3proxy: Print a traceback as well as adding an X-Spambayes-Exception header when there's an exception raised while processing a message. + Tony Meyer 18/07/2003 Fix [ 773452 ] Unable to use fractional number as spam_threshold. Richie Hindle 18/07/2003 pop3proxy: "ASCII decoding error" problem fixed. Skip Montanaro 15/07/2003 dbmstorage: trivial hack to give dumbdbm a sync() method (which Shelve will call) and hopefully reduce database corruption + Mark Hammond 09/07/2003 Outlook: Include the Windows version in the log. + Mark Hammond 09/07/2003 Outlook: Use the passed field name rather than hardcoded "Spam". + Mark Hammond 09/07/2003 Fix 765042: IMAP mail fails to filter Tony Meyer 09/07/2003 Allow $ in pathnames, which fixes [ 768162 ] UNC path for data_directory? Tony Meyer 09/07/2003 mboxtrain: Use /tmp/ as the temp directory, not /cur/tmp or /new/tmp. Fixes [ 768221 ] v1.0a4 dies when training on Maildir From anadelonbrin at users.sourceforge.net Sat Aug 30 01:52:15 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sat Aug 30 03:52:20 2003 Subject: [Spambayes-checkins] spambayes WHAT_IS_NEW.txt,1.7,1.8 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv30492 Modified Files: WHAT_IS_NEW.txt Log Message: Replace with a version for 1.0a5. (Only one change for imapfilter! Either no-one likes it, or it's working surprisingly well ). Index: WHAT_IS_NEW.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/WHAT_IS_NEW.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** WHAT_IS_NEW.txt 7 Jul 2003 00:46:29 -0000 1.7 --- WHAT_IS_NEW.txt 30 Aug 2003 07:52:12 -0000 1.8 *************** *** 1,6 **** This file covers the major changes between each release. For more details, ! the reader is referred to the changelog, or for extreme details, to the ! check-ins archive. ! Changes are broken into sections for each application, plus one that will probably only interest developers, and one for everything else. --- 1,7 ---- This file covers the major changes between each release. For more details, ! the reader is referred to the changelog (changelog.txt in the main directory ! of the archive), or for extreme details, to the check-ins archive (please see ! ) ! Changes are broken into sections for each application, plus one that will probably only interest developers, and one for everything else. *************** *** 9,50 **** noted in the "Transition" section. ! New in Alpha Release 4 ====================== Outlook Plugin -------------- ! o Display a message for "Delete as Spam" or "Recover from Spam" when ! SpamBayes is not enabled. ! o The toolbar is now initialized when "Outlook Today" is the default view. ! POP3 Proxy ! ---------- ! o Fix a bug where long attachments would be broken. ! o If an exception occurs parsing a message, recover and append a new ! 'exception' header. ! (This will be added to other SpamBayes applications by the next ! release). ! o Stop including the trailing dot in messages. IMAP Filter ----------- ! o In imapfilter, try to append without flags if appending fails. ! o Fix the -i switch in imapfilter and an import error. ! o Don't try and get password from options if -p is specified in imapfilter. ! ! Developer ! --------- ! o Various changes/improvements to storage.py. ! Note that this includes a fix for a potentially serious bug introduced ! in a3 which could result in incorrect token counts. General ------- ! o The web interface (used by pop3proxy and imapfilter) now shows the ! correct date and time in the footer. ! o A new stripper to squash yet another way of hiding content in HTML spam, ! like Ereywl55ctions to hide ! Erections. Transition --- 10,101 ---- noted in the "Transition" section. ! New in Alpha Release 5 ====================== Outlook Plugin -------------- ! o Added a diagnostics dialog with functions to make it easier for users to ! help developers track down and fix bugs. ! o Added a 'timer' method of determining when to filter mail that should work ! better with Outlook's rule system. ! o Added a button on the Advanced tab of the dialog to display the SpamBayes ! data folder. ! o Moved "Filter Now" to an item on the drop down menu on the toolbar. ! o Items that can be filtered and trained include "IPM.Note" (normal messages) ! and "IPM.Anti-Virus*" (virus alerts by some software). ! o Changed the default filter action to "move" (instead of "untouched"). ! o Added a Wizard to assist with initial configuration (this will present ! itself when necessary). ! o Changed to allow filtering to be enabled, even if no training has been done. ! o Added a "New Folder" button to the folder selector dialog. ! o Massive changes to the dialog system (which should fix some problems), ! including changing the configuration dialog to a tabbed interface. ! o "Show Clues" now shows the percentage, as well as the raw score. ! o Added a "Help" menu to the drop down menu, with various information. ! o Added the ability to check for the latest version via an item on the drop ! down menu. ! o Hopefully, the "unread flag" issue is now fixed. ! o Fixed many problems with working on systems where English is not the ! default language, or where profile names have non-English characters. ! POP3 Proxy / SMTP Proxy / POP3 Proxy Service ! -------------------------------------------- ! o Starting and stopping the POP3 Proxy service (for Windows NT, Windows ! 2000 and Windows XP users) has been improved. Most noticeably, this ! means that the SMTP Proxy will start (if it is needed) as well. ! o Improve the "notate to" and "notate subject" options, so that ham and ! unsure messages can also be (optionally) notated in these fields. ! o Add the ability to skip caching messages that are over a (user ! configurable) size, so that you can keep the size of the cache ! directories smaller, once these messages are correctly classified. ! o Added the ability to skip caching messages that have a precedence of ! "bulk" (most mailing list messages), so that you can keep the size ! of the cache directories (and review list) smaller, once these messages ! are correctly classified. ! o Fixed the "ASCII decoding error" problem. ! o The SMTP proxy tries harder to pass on the command formatted exactly ! as it was given. This should make it more reliable. ! o Add the ability to have the SMTP proxy train on the message sent to it, ! rather than looking up the id in the cache (which is still possible, and ! generally the better option). ! o Removed the ability to add the SpamBayes identification number to the ! body of messages (it can still be added as a header). ! o The review messages page now puts unsure messages at the top. ! o The POP3 proxy should now work with fetchmail. ! o You can once again specify local addresses as well as ports for the ! POP3 proxy to listen on (was broken in 1.0a3 and 1.0a4). IMAP Filter ----------- ! o If you didn't use the -p switch to enter your password ! interactively, imapfilter would try and get it from the options, ! but if it wasn't there yet (because you hadn't done the setup yet), ! it would crash. This is now fixed. General ------- ! o Added the ability to store the SpamBayes database in a mySQL or ! postreSGL database table (currently supported by hammiefilter and ! the POP3 proxy). ! o Removed the ability to use the 'dumbdbm' as the storage method. ! (See the FAQ for reasons why). ! o We now allow the '@' and '=' characters in paths. ! o Added a simple n-way classifier using a cascade of binary SpamBayes ! classifiers. ! o Added version information to the web interface. ! o Fixed the yellow colour of the header boxes in the web interface. ! o Fixed restoring defaults from the web interface. ! o Added a missing line break in the status pane on the web interface ! when there are no proxies configured. ! o Prevent the "Show clues" links on the web interface's training page ! from word-wrapping and making all the table rows two lines high. + Developer + --------- + o Created a directory for test suites, including a storage.py test. + o An empty 'allowed values' now allows an empty string. + o Add a get_option method, so an option instance itself can be fetched. + o Support fetching the "latest" set of version data from the spambayes + web site. Transition *************** *** 57,61 **** =================== The following bugs tracked via the Sourceforge system were fixed: ! 761677, 761670 A url containing the details of these bugs can be made by appending the --- 108,115 ---- =================== The following bugs tracked via the Sourceforge system were fixed: ! 776808, 795749, 787251, 790051, 743131, 779319, 785389, 786952, 788495, ! 790406, 788008, 787296, 788002, 780612, 784323, 784296, 780819, 780801, ! 779049, 765912, 777026, 777165, 693387, 690418, 719586, 769346, 761499, ! 769346, 773452, 765042, 760062, 768162, 768221 A url containing the details of these bugs can be made by appending the *************** *** 66,74 **** Feature Requests Added ====================== ! The following feature request tracked via the Sourceforge system was added: ! 755098 A url containing the details of these feature requests can be made by appending the request number to this url: http://sourceforge.net/tracker/index.php?func=detail&group_id=61702&atid=498104&aid= --- 120,138 ---- Feature Requests Added ====================== ! The following feature requests tracked via the Sourceforge system were added: ! 789916, 698036 A url containing the details of these feature requests can be made by appending the request number to this url: http://sourceforge.net/tracker/index.php?func=detail&group_id=61702&atid=498104&aid= + + + Patches integrated + =================== + The following patches tracked via the Sourceforge system were integrated: + 791254, 790615, 788001, 769981 + + A url containing the details of these feature requests can be made by + appending the request number to this url: + http://sourceforge.net/tracker/index.php?func=detail&group_id=61702&atid=498105&aid= From anadelonbrin at users.sourceforge.net Sat Aug 30 02:08:35 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sat Aug 30 04:09:09 2003 Subject: [Spambayes-checkins] spambayes WHAT_IS_NEW.txt,1.8,1.9 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv32472 Modified Files: WHAT_IS_NEW.txt Log Message: Opps. I forgot about the transition section. (If anyone can think of any transition issues that I have forgotten, please add them!) Index: WHAT_IS_NEW.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/WHAT_IS_NEW.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** WHAT_IS_NEW.txt 30 Aug 2003 07:52:12 -0000 1.8 --- WHAT_IS_NEW.txt 30 Aug 2003 08:08:32 -0000 1.9 *************** *** 90,93 **** --- 90,98 ---- o Prevent the "Show clues" links on the web interface's training page from word-wrapping and making all the table rows two lines high. + o Added a new script (code-named 'overkill.py') which enables + 'drag and drop' training for POP3 users. This is currently still in + the experimental stage, and anyone interested in trying it out should + enquire on the SpamBayes mailing list + (). Developer *************** *** 101,106 **** Transition ========== ! Transition between release a3 and a4 should be seamless. Refer to the a3 ! release for information about transitioning between a2 and a4. --- 106,136 ---- Transition ========== ! If you are transitioning from a version older than 1.0a4, please also ! read the notes in the previous release notes (accessible from ! <>). ! ! o If you were previously using the 'dumbdbm' storage method (you will ! have files called "hammie.db.dat", "hamie.db.dir" and "hammie.db.bak", ! rather than one file called "hammie.db"), then you will need to ! change to using either a pickle (please see the FAQ: ! ), bsddb, gdbm, or one of the new SQL ! based storage methods. The 'dumbdbm' storage method resulting in ! many databases being corrupted, and was never the best choice for ! storage, in any case. Although you can use the dbExpImp.py script ! to convert your database to your new storage system, we recommend ! that you retrain from scratch, as it is most likely that your ! database has been corrupted. ! o If you were using the options to notate the "To" or "Subject" headers ! with the message's classification, you will need to update your ! configuration file, as the format for these options have changed. ! o The ability to add the SpamBayes id to the message body has been ! removed, which means that Outlook Express users can no longer use ! the SMTP proxy and have it retrieve messages from the cache. These ! users can use the SMTP proxy by training on the forwarded message ! itself, but this is not recommended, as clues in the message will have ! changed (the "From" address will be yours, for example). At this time, ! you will have to use the web interface for training, although there is ! the possibility of 'drag and drop' training being added in a release in ! the near future. From richiehindle at users.sourceforge.net Sat Aug 30 15:35:18 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sat Aug 30 17:35:30 2003 Subject: [Spambayes-checkins] spambayes/spambayes UserInterface.py, 1.19, 1.20 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv17685 Modified Files: UserInterface.py Log Message: [ 797776 ] Update the web UI's Upload form to reflect the fact that you can now upload Outlook Express DBX files. Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** UserInterface.py 28 Aug 2003 21:17:29 -0000 1.19 --- UserInterface.py 30 Aug 2003 21:35:16 -0000 1.20 *************** *** 296,300 **** # Attempt to convert the content from a DBX file to a standard mbox if file: ! content = self._convertOutlookExpressToMbox(content) # Convert platform-specific line endings into unix-style. --- 296,300 ---- # Attempt to convert the content from a DBX file to a standard mbox if file: ! content = self._convertToMbox(content) # Convert platform-specific line endings into unix-style. *************** *** 329,338 **** self._writePostamble() ! def _convertOutlookExpressToMbox(self, content): ! """Check if the uploaded mailbox file is an Outlook Express DBX one. ! In such a case we use the module oe_mailbox to convert the DBX ! content into a standard mbox file. When the file is not a DBX one, ! this method returns the original content. Testing if the file is a DBX one is very quick (just a matter of checking the first few bytes), and should not alter the overall performance.""" --- 329,339 ---- self._writePostamble() ! def _convertToMbox(self, content): ! """Check if the given buffer is in a non-mbox format, and convert it ! into mbox format if so. If it's already an mbox, return it unchanged. ! ! Currently, the only supported non-mbox format is Outlook Express DBX. In such a case we use the module oe_mailbox to convert the DBX ! content into a standard mbox file. Testing if the file is a DBX one is very quick (just a matter of checking the first few bytes), and should not alter the overall performance.""" *************** *** 434,438 **** form = self.html.upload.clone() del form.submit_classify ! return self._buildBox("Train on a given message", 'message.gif', form) def reReadOptions(self): --- 435,440 ---- form = self.html.upload.clone() del form.submit_classify ! return self._buildBox("Train on a message, mbox file or dbx file", ! 'message.gif', form) def reReadOptions(self): From richiehindle at users.sourceforge.net Sat Aug 30 15:37:13 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sat Aug 30 17:37:31 2003 Subject: [Spambayes-checkins] spambayes/spambayes/resources ui.html, 1.18, 1.19 ui_html.py, 1.19, 1.20 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes/resources In directory sc8-pr-cvs1:/tmp/cvs-serv17994 Modified Files: ui.html ui_html.py Log Message: [ 797776 ] Update the web UI's Upload form to reflect the fact that you can now upload Outlook Express DBX files. Index: ui.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui.html,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ui.html 28 Aug 2003 21:20:08 -0000 1.18 --- ui.html 30 Aug 2003 21:37:10 -0000 1.19 *************** *** 253,257 ****

        ! Either upload a message or mbox file:
        Or paste one whole message (including headers) here:
        --- 253,257 ---- ! Either upload a message, mbox or dbx file:
        Or paste one whole message (including headers) here:
        Index: ui_html.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui_html.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ui_html.py 28 Aug 2003 21:20:08 -0000 1.19 --- ui_html.py 30 Aug 2003 21:37:10 -0000 1.20 *************** *** 6,87 **** import zlib ! data = zlib.decompress("x[}s63\016(o\022sDI%%ygwt<\020\011I\004\004m2ow\001\ ! m38\031K$b\027ӯ?-~`o\027߱\037߼yNŹnx1\012آ\ ! Y\031Xf<\031/~_~1ݨ4O#TJ\004G߼u%ߊX})Qx(ccR8\ ! (\037T̻,:\036\013%aÍxpnܹ}\036\027tF,6\001E\0177\012X\ ! \020L?i\017πF!\017XZ\020<#\0054J\026RmI\006K\031m'\002\012\023M\"\001\ ! +<`\033\012\025Xل\005__~\0228켒E\012}[\004O8\010Cb\020OH\ ! |r\033Æ֍\035m^\005/\012FF\024\033\016D\000KD6\026w4sK\006|Ds7Z,I<\ ! .dE0S\030\010\003Zg3\ ! /4DlY\007PhQ3\023]\023'\013\031U-7t=\002Q8T\002cB`\"\ ! xoṫ\003[hkuʪx~z\001\004%C\022)3mΞYg[yy1\036\037\027\006\014\ ! ـ|%[\0114\\\001*@\010j#X\"CE+!\022MBB\031[\031ٷ\010E\001\ ! (oNQ\ ! \006\011LgI&r\"I`dY`*SB-9h:k\037\007\020CԌ_E`\ ! E@GяA\021`^\037-BH\016}\014@}\000\015\003Ai:,\025WUM3E\033ȗ۠\ ! O,\032V\011Z|9#(,C'\034\025\032J\033I4tK\016\007`u҄b\030voG\ ! uuju\017\035\006cE\000~+EUąXdd!n B]1k6Q\030w\003\0354WPKmnu\002\ ! =\037m\ ! A?feUΰ^v\027@y0W\006N\014ӧJIg\016M=mȦ;1q;\020g\"]Sy%}\003\ ! \030\027iR\000(*^?\006ͶBe#PldCltRKǰ\006P\012\010ྻX8\ ! aJ\00468 aXz E\011b|\011\037x\010\014\024^\006xĄ\037\0127s?bv\"\026\007e\ ! Lce9XK7$DЍ?K \020\017Gq\001#\012{4$\005\034\030)\016L<\037J}\ ! E\000=?w\017!t7\027i+m\",.\013-ox<׋?ʴ%Lc\ ! \0363H\027ҔR>5+\027ɰJ!\037!\037%{ߌ\022!{~3S[deП~9u\ ! c{1t\014NY̦4L\000/vO*!g;\020?ǿpG԰O\033\\h=Үh6c'޺\ ! \001ŗ(5x?&vNSԙ\035)Nމ\014~\011\022\001zE%\006+|5\037/4\ ! \021)ˎhxzϻou\002\024񮫥\027\002{\014'\024KRf\034m!\ ! f'\035٘9͘lF2\000+z[r*9\"\002\022\031L'1\010\000\\v| c\ ! 먑&Z7P\002'Lt7PA'NdKLKr>X\001ik\034uwM\035\036SÛe\017\034\015\027rFyͯp\023\0136\"(,\026\000\020\ ! eor \025P]]\\*\"RWΩ2;\0012&\011jS:T/t)x\024KA%n'd{Ӱ\ ! \003EV#Ͷy\036L\031x?.\013\002!\005\023 a2$\ ! ̤(*\0358\023}^0x\025tgw\016hK\032҇\015x[\0370TvMOo>J1ΧI\ ! \0159ua\017K1fIx]a\035\005#S$ζFiT\\>tJPq\036\003VTҥf\ ! \025;HRb;l\007usc\012\037\020<+)(q8?\011\0266\010A_\020\015\ ! ծ ^0z\016n1}x\034֘=\026J%8Ov\0275@\011^+2Zl\ ! C\037t\011\000\007hu!SƶPVx\003うaJЋ\036 tY%_ƐhnuժPw\ ! H0x\014Z 2\016O_\\\025_\022<\003btr*T˛\005x\031}̒1\ ! }\020E8C`P?`kiN\027\017X\022\024Z`Ki\000KVC>pMAE?\ ! 8IE+x\013s\011_-j\032\022Po\023L\014\005\024aJ>\022*ݾ^*>\002~ӭ~N\ ! u\037O{\006Ao{?|\027q\027ţ\023o\003:W퇫\026\001\021R\0245)NdA}\ ! MK6|lNeǹy2'v\\.o]8}\017\007\016\027W(\015`$G\004\036ق\ ! VJ:\012]3H;7f$\026y\036\011e'}\005g\035ڍ99ļ\015@M\012N;NF\ ! \021I\016\0356\005\007\011\014:^_,\0120\032S\000jpΖW\017\035'6Ξ\036\ ! \001L:¬7q\010K\"*݂УF\037B0,Tu?ʛt\013t븫[\ ! \032~H:\033}V\025\005}\011r24K&^\006\035\"F.\015iD\023\026~O/@ﵤ߉w\002\034]\ ! \031軒\011`}'i;~{\014a&yĨYCX3u-Xͦ\0363 \010V1&\ ! \017uK;DDLݍN]\0025\025^\023t\013\014VT\010\035w\025\000\0271=\ ! \0314W#\036\006\035=xt˳PDZ>\015,V=q\002<|_kCnh6\0172\ ! ++xRˆRz}3\003k=r1\022نM@Jp[\033(Ay\001\ ! Y\015gCxS\020\033\0159V[8\013\013FA}+lYVEf_ɊJ_\036\033+rt\016b\ ! \025D=L|.Bv\022\027\035\007ad̩T>\031F\021\013\035F[n5\ ! b\021Z Nϖg;d˂ge\\\ ! 2tz|S\011}\013\036w\025W`qpr\006|+Jc)\012}VbC1\000MU\ ! \007\037u|p.\012NB\011jd F8l::Tu<>\013QZ3z&g?yf\ ! }a\007\000,\020<#^A\003t,\014fe%\032\0042ڲOl\005\020f\033\031E̓}V\ ! e6\"\025U\034\023b\035g3}E\003\016pJ\026)\000\013>K\006Cb_H|v\ ! \033Áލ\023m^{/\012&\024k\016D\000L\"\032q\033;Zy0$\0036i5Z\000\000w(JlC=\ ! qՃ[{\00451`sq-3u\035\020u\016194п&'dOO\ ! G\"\"j[|p\015\011?[\026&,\027 =e\016\032\016gn\0008]\010\027j@a˃2\ ! (\021\005e~\002x\000\0164:\005PwQ\035V?c\022&\002\"\0205+Le*H\034)\012\026w\ ! \007)\037_\016d-\023V\023S]Ի/@0EQ\034Hy*qv\016\035-ފK{1g8\ ! \001r\023l\025'硌`Ao,\0228\003\"T\033\022)o\016x\026\035H\024\010\032flhdZ[\022^\002\ ! %4߂u\0001`3Ȇ\"\011\0003!\012\036\" 8OSC@\024uV)h,ɢ-\020\024,\ ! Il:MA\020jë.^jBU:g\0070J \037t@\"J\030TP̀%lNQbA$\ ! {\020JMD\026+\017*VD\003#A\021t\014\016\007v\017\023PsR~\003\024z,\030D8\007\ ! [\020feBD%&\020|z\033T\031#pD@\006qQv6D4v\000WS}26CAp\ ! j<\023d#\024w!k\017\032QQ\\\005\036,BQ\000\013PM\032&L]Z\006q\025C;a6\027\001\ ! 8qI-n^[83բ՞\031C.V\026Z\026c[\0275\037p+A,\002K[\015\0122,x\005,Vhn}EC\033z$TM\0028\011P\ ! hU\006j\035\007,D:\010\010Q\012\003GvJm\020kPٺƍV$Q\004Vt@\ ! ZZYR4 %Ц2m_y\025\011hK\034Ă\021\022@Չ\003bT\012\012\024\024Q=>\ ! '(zrtcIڭ\"I`fQꬪ\032pf\027\007^GCҌ\ ! \024\025\024\001\001D7\006F8u]\010r\013!r{\001uU\004\002=\015T\007^\001*xU\023_z.1|\ ! 8xZzӰ˚An\031\032If\021\036,q4\024pO\013\007z I(\012'+\001\ ! iXWV0P\031lWD\025o%\0231L\0122\007\010\037+zk\017i݁s\011uV&\ ! \\u.\001\025jy7:w\031l}W\"\031Dq\031qQ'O\031j\022<{S/v\ ! W<\035O\003>^\030KLv/[4\020\025?\000M,[\033`[\005I@Pt'/\ ! &]\011Ja8Oz\013\014!+m]ُ-SɊ'҉GN@\024\027ū\030֎fuQCoA\006O\ ! \015gmcVօM%҃\01130b\030>vzk ]9S6\031Rs?\ ! Žٛcq{&\025\000\014׏f!;\035\025U\005.\015c\000o\015\0338\011b\020\023\014\032h\ ! \036v\001YnJᵣc\026S\014jE?@\036\032\034&k\031F\023?iU\"k\011~gq!BN\ ! \016@=+S`*\020CQj\015Mi`#?\022$\0273Z\033Y ̆f-\024bIx\021\021M\ ! ;zJzHq_I\015 6\004S-`PUNC\013+[Sś\015Bk0ا\033\021x\016Ą(\002cӠ*\ ! \012\034k)\000\002\0250\0254w]\004`X…p&~_\015VAc8L\020\ ! P2EĦ7\021D&`&\0110CI#j'r>8\003FuYˮL\002NC3=\000S\003\ ! \031:E@a\010\035\013T@\006t\012\\\027\000Ȁ|4:]#aއ\036\ ! t0( +ZZ%\"cn] d\015\034\0078K\017@\034Z\031ԎۣT.XȁoR\017\ ! !w\0170s7{C\026\"\010870~w~UO~>={|\016\ ! LI̔\016z3~\006ARTʧ\026x^D2Sp'Gɞ?gݖI\"5D\035S?uHRM\ ! 0\"\011ٜ\005\0164<\022b\006J\003\020s\004OzB\035/ܙ7R63͎\026\ ! \013vm:\000_lDA85uRgPwRN\024`v^\015gz\034 );О~Q=dG5\ ! K\033\036\021\015/>^-]\037\033&ZW]UAv,U\035\030\033\011~Q?\030Co9߼dX֟/9\010\ ! qַLGpzs1\000ЯT@Ȼ\021\020ȸb:kM`R\003Fu|\ ! LNA#\003M7@\002#Lp7@A#N`[R,\031\031nbKyAL\035?,St'C\ ! nMu\011]{sp\017%R,\024\013\034*=\012\031|\007{bx\"\007s׎\031Xwq\026Daⶠ?\ ! \004,x[cG\000eqY\02149D\026\007&ĬM\016P\003ץQ,\005Ւ\020\ ! O\006\024Q\0247l\0339=@1pZ{N]\0240\004]\012x\"@a\000w\003!hoГJf\ ! ̪Fhw\012kv!\030qQ\016\022ݠ$TCH\024e\000i\007\011\003w=I\035\031iӺao\ ! suH\036\015\003\033s\032N\024F3\001n\"/*yQ\021V\007\021Q1U4\024hM\032TY\\X\ ! n\031~c&\012ҭ\025S=kr\002%XPiHP@wI\023u\001QqE=\012BgvV\030\ ! }e^w`!U`b\025\016GW*Ŋ\00381\006Ty)_m\010o=\012\ ! ЧA-8ÑM\002\005c\023]c2\005@b)\0111\002W\026\031W2\007V\036*\004D[C`H-\ ! h\007V/(tM&wHBs\014eH+rUM=%96_u\\\ ! jHnW4hx|\000g7Ǿ Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv24897 Modified Files: pop3proxy.py Log Message: The X-Spambayes-Exception header now includes a traceback as well as the exception. Index: pop3proxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** pop3proxy.py 26 Aug 2003 01:21:40 -0000 1.93 --- pop3proxy.py 30 Aug 2003 22:27:44 -0000 1.94 *************** *** 89,98 **** """ ! import os, sys, re, errno, getopt, time, traceback ! import socket from thread import start_new_thread from email.Header import Header - import smtpproxy import spambayes.message from spambayes import Dibbler --- 89,96 ---- """ ! import os, sys, re, errno, getopt, time, traceback, socket, cStringIO from thread import start_new_thread from email.Header import Header import spambayes.message from spambayes import Dibbler *************** *** 491,494 **** --- 489,494 ---- messageText = "\r\n".join(headers) + "\r\n\r\n" + body + crashMe() + except: # Something nasty happened while parsing or classifying - *************** *** 496,509 **** # This is one case where an unqualified 'except' is OK, 'cos # anything's better than destroying people's email... ! eType, eValue, eTraceback = sys.exc_info() headerName = 'X-Spambayes-Exception' ! file, line, func, code = traceback.extract_tb(eTraceback)[-1] ! ! # Build the header. ! details = "%s(%s) in %s() at %s line %d: %s" % \ ! (eType, eValue, func, file, line, code) ! header = Header(details, header_name=headerName, ! continuation_ws='\t') ! # Insert the header, converting email.Header's '\n' line # breaks to POP3's '\r\n'. --- 496,510 ---- # This is one case where an unqualified 'except' is OK, 'cos # anything's better than destroying people's email... ! stream = cStringIO.StringIO() ! traceback.print_exc(None, stream) ! details = stream.getvalue() ! ! # Build the header. This will strip leading whitespace from ! # the lines, so we add a leading dot to maintain indentation. ! detailLines = details.strip().split('\n') ! dottedDetails = '\n.'.join(detailLines) headerName = 'X-Spambayes-Exception' ! header = Header(dottedDetails, header_name=headerName) ! # Insert the header, converting email.Header's '\n' line # breaks to POP3's '\r\n'. *************** *** 514,518 **** # Print the exception and a traceback. ! traceback.print_exc() # Restore the +OK and the POP3 .\r\n terminator if there was one. --- 515,519 ---- # Print the exception and a traceback. ! print >>sys.stderr, details # Restore the +OK and the POP3 .\r\n terminator if there was one. *************** *** 739,742 **** --- 740,744 ---- # SMTP proxy information in their configuration, then nothing will # happen. + import smtpproxy servers, proxyPorts = smtpproxy.LoadServerInfo() smtpproxy.CreateProxies(servers, proxyPorts, state) From richiehindle at users.sourceforge.net Sat Aug 30 16:45:06 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sat Aug 30 18:45:10 2003 Subject: [Spambayes-checkins] spambayes pop3proxy.py,1.94,1.95 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv26951 Modified Files: pop3proxy.py Log Message: Fixed the horribly broken code that was just checked in by my evil twin. Index: pop3proxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** pop3proxy.py 30 Aug 2003 22:27:44 -0000 1.94 --- pop3proxy.py 30 Aug 2003 22:45:04 -0000 1.95 *************** *** 93,96 **** --- 93,97 ---- from email.Header import Header + import smtpproxy import spambayes.message from spambayes import Dibbler *************** *** 489,494 **** messageText = "\r\n".join(headers) + "\r\n\r\n" + body - crashMe() - except: # Something nasty happened while parsing or classifying - --- 490,493 ---- *************** *** 740,744 **** # SMTP proxy information in their configuration, then nothing will # happen. - import smtpproxy servers, proxyPorts = smtpproxy.LoadServerInfo() smtpproxy.CreateProxies(servers, proxyPorts, state) --- 739,742 ---- From richiehindle at users.sourceforge.net Sat Aug 30 17:39:34 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sat Aug 30 19:39:38 2003 Subject: [Spambayes-checkins] spambayes/spambayes Dibbler.py,1.3,1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv3747 Modified Files: Dibbler.py Log Message: The web UI's Shutdown command now waits for any open proxy connections to finish before exiting the process. Previously, Shutdown would just exit, causing the proxied connections to abort. This paves the way for pop3proxy_service.py to shut down cleanly as well. Index: Dibbler.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Dibbler.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Dibbler.py 29 Jan 2003 03:23:34 -0000 1.3 --- Dibbler.py 30 Aug 2003 23:39:32 -0000 1.4 *************** *** 318,321 **** --- 318,322 ---- BrighterAsyncChat.__init__(self, map=context._map) BrighterAsyncChat.set_socket(self, clientSocket, context._map) + self._context = context self._server = server self._request = '' *************** *** 409,414 **** eType, eValue, eTrace = sys.exc_info() if eType == SystemExit: ! ##self.shutdown(2) ! raise message = """

        500 Server error

        %s
        """ details = traceback.format_exception(eType, eValue, eTrace) --- 410,429 ---- eType, eValue, eTrace = sys.exc_info() if eType == SystemExit: ! # Let any existing connections close down first. This ! # has happened when all we have left are Listeners and ! # _HTTPHandlers (including this one and any others ! # that are using keep-alive; no others can be actually ! # doing any work because *we're* the one doing the ! # work). ! def isProtected(dispatcher): ! return not (isinstance(dispatcher, Listener) or ! isinstance(dispatcher, _HTTPHandler)) ! ! map = self._context._map ! while len(filter(isProtected, map.values())) > 0: ! asyncore.poll(timeout=1, map=map) ! ! raise SystemExit ! message = """

        500 Server error

        %s
        """ details = traceback.format_exception(eType, eValue, eTrace) From richiehindle at users.sourceforge.net Sat Aug 30 18:26:13 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sat Aug 30 20:26:17 2003 Subject: [Spambayes-checkins] spambayes/windows pop3proxy_service.py, 1.8, 1.9 Message-ID: Update of /cvsroot/spambayes/spambayes/windows In directory sc8-pr-cvs1:/tmp/cvs-serv10261 Modified Files: pop3proxy_service.py Log Message: Resolved an ugly cyclic dependency problem between pop3proxy and smtpproxy. Index: pop3proxy_service.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/pop3proxy_service.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pop3proxy_service.py 18 Aug 2003 06:08:28 -0000 1.8 --- pop3proxy_service.py 31 Aug 2003 00:26:11 -0000 1.9 *************** *** 44,48 **** # The spambayes imports we need. - import smtpproxy # eek - pop3proxy fails to import unless we do this :( import pop3proxy --- 44,47 ---- From richiehindle at users.sourceforge.net Sat Aug 30 18:29:09 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sat Aug 30 20:29:13 2003 Subject: [Spambayes-checkins] spambayes pop3proxy.py,1.95,1.96 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv10637 Modified Files: pop3proxy.py Log Message: The pop3proxy_service shutdown code now goes through the same shutdown procedure as the web UI's Shutdown button. Resolved an ugly cyclic dependency problem between pop3proxy and smtpproxy. Index: pop3proxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/pop3proxy.py,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** pop3proxy.py 30 Aug 2003 22:45:04 -0000 1.95 --- pop3proxy.py 31 Aug 2003 00:29:07 -0000 1.96 *************** *** 93,97 **** from email.Header import Header - import smtpproxy import spambayes.message from spambayes import Dibbler --- 93,96 ---- *************** *** 739,742 **** --- 738,742 ---- # SMTP proxy information in their configuration, then nothing will # happen. + import smtpproxy servers, proxyPorts = smtpproxy.LoadServerInfo() smtpproxy.CreateProxies(servers, proxyPorts, state) *************** *** 750,756 **** def stop(state): ! state.bayes.store() ! # should we be calling socket.shutdown(2) and close_when_done() for each ! # BayesProxy object? # =================================================================== --- 750,760 ---- def stop(state): ! # Shutdown as though through the web UI. This will save the DB, allow ! # any open proxy connections to complete, etc. ! from urllib2 import urlopen ! from urllib import urlencode ! urlopen('http://localhost:%d/save' % state.uiPort, ! urlencode({'how': 'Save & shutdown'})).read() ! # =================================================================== From richiehindle at users.sourceforge.net Sat Aug 30 20:09:42 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sat Aug 30 22:09:47 2003 Subject: [Spambayes-checkins] spambayes/spambayes Dibbler.py,1.4,1.5 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv23169 Modified Files: Dibbler.py Log Message: While waiting for existing connections to complete during shutdown, don't accept any more incoming connections. Index: Dibbler.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Dibbler.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Dibbler.py 30 Aug 2003 23:39:32 -0000 1.4 --- Dibbler.py 31 Aug 2003 02:09:40 -0000 1.5 *************** *** 410,426 **** eType, eValue, eTrace = sys.exc_info() if eType == SystemExit: # Let any existing connections close down first. This ! # has happened when all we have left are Listeners and ! # _HTTPHandlers (including this one and any others ! # that are using keep-alive; no others can be actually ! # doing any work because *we're* the one doing the ! # work). def isProtected(dispatcher): ! return not (isinstance(dispatcher, Listener) or ! isinstance(dispatcher, _HTTPHandler)) ! map = self._context._map ! while len(filter(isProtected, map.values())) > 0: ! asyncore.poll(timeout=1, map=map) raise SystemExit --- 410,430 ---- eType, eValue, eTrace = sys.exc_info() if eType == SystemExit: + # Close all the listeners so that no further incoming + # connections appear. + contextMap = self._context._map + for dispatcher in contextMap.values(): + if isinstance(dispatcher, Listener): + dispatcher.close() + # Let any existing connections close down first. This ! # has happened when all we have left are _HTTPHandlers ! # (this one plus any others that are using keep-alive; ! # none of the others can be actually doing any work ! # because *we're* the one doing the work). def isProtected(dispatcher): ! return not isinstance(dispatcher, _HTTPHandler) ! while len(filter(isProtected, contextMap.values())) > 0: ! asyncore.poll(timeout=1, map=contextMap) raise SystemExit From richiehindle at users.sourceforge.net Sat Aug 30 20:17:48 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sat Aug 30 22:17:52 2003 Subject: [Spambayes-checkins] spambayes/windows pop3proxy_service.py, 1.9, 1.10 Message-ID: Update of /cvsroot/spambayes/spambayes/windows In directory sc8-pr-cvs1:/tmp/cvs-serv24125 Modified Files: pop3proxy_service.py Log Message: Now that we wait for existing connections to complete during shutdown, increased the service-stop timeout from 20 to 60 seconds (you have to draw the line somewhere, but 20 seconds was too quick). Index: pop3proxy_service.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/pop3proxy_service.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pop3proxy_service.py 31 Aug 2003 00:26:11 -0000 1.9 --- pop3proxy_service.py 31 Aug 2003 02:17:46 -0000 1.10 *************** *** 106,110 **** # Either user requested stop, or thread done - wait for it # to actually stop, but reporting we are still alive. ! for i in range(20): # 20 seconds to shut down. self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) self.event_stopped.wait(1) --- 106,113 ---- # Either user requested stop, or thread done - wait for it # to actually stop, but reporting we are still alive. ! # Wait up to 60 seconds for shutdown before giving up and ! # exiting uncleanly - we wait for current proxy connections ! # to close, but you have to draw the line somewhere. ! for i in range(60): self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) self.event_stopped.wait(1) From richiehindle at users.sourceforge.net Sat Aug 30 20:26:27 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sat Aug 30 22:26:31 2003 Subject: [Spambayes-checkins] spambayes CHANGELOG.txt,1.12,1.13 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv25029 Modified Files: CHANGELOG.txt Log Message: Updated with tonight's work. Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/CHANGELOG.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CHANGELOG.txt 30 Aug 2003 07:03:25 -0000 1.12 --- CHANGELOG.txt 31 Aug 2003 02:26:25 -0000 1.13 *************** *** 1,4 **** --- 1,6 ---- Alpha Release 5 =============== + Richie Hindle 31/08/2003 The web UI's Shutdown command, and stopping the pop3proxy_service, now wait for any open proxy connections to finish before exiting the process. + Richie Hindle 31/08/2003 X-Spambayes-Exception headers now contain a traceback as well as the exception. Richie Hindle 29/08/2003 Fix the yellow colour of the header boxes in the web interface in strict browers (i.e. not IE ;) Tony Meyer 28/08/2003 smtproxy: try a bit harder to proxy the exact command if we aren't going anything with it, and try to match it more closely even if we are. From mhammond at users.sourceforge.net Sat Aug 30 23:38:55 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 31 01:38:58 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 msgstore.py, 1.69, 1.70 tester.py, 1.14, 1.15 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv12507 Modified Files: msgstore.py tester.py Log Message: msgstore: add an internal "_GetMessageTextParts()" method the test suite can use for sanity checks. tester: Cache the good and bad tokens we use to generate test mails, and print some stats for how many messages don't have headers, text body or html body. How many don't have HTML should scare you - see [798029] Index: msgstore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** msgstore.py 27 Aug 2003 12:10:48 -0000 1.69 --- msgstore.py 31 Aug 2003 05:38:52 -0000 1.70 *************** *** 700,703 **** --- 700,708 ---- def _GetMessageText(self): + parts = self._GetMessageTextParts() + # parts is (headers, body, html), but could possibly grow + return "\n".join(parts) + + def _GetMessageTextParts(self): # This is finally reliable. The only messages this now fails for # are for "forwarded" messages, where the forwards are actually *************** *** 793,797 **** body = collect_text_parts(msg) ! return "%s\n%s\n%s" % (headers, html, body) def _GetFakeHeaders(self): --- 798,802 ---- body = collect_text_parts(msg) ! return headers, body, html def _GetFakeHeaders(self): Index: tester.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/tester.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tester.py 24 Aug 2003 23:51:32 -0000 1.14 --- tester.py 31 Aug 2003 05:38:52 -0000 1.15 *************** *** 63,67 **** --- 63,72 ---- # bayes word list looking for any word with zero count in the # non-requested category. + _top_ham = None + _top_spam = None def FindTopWords(bayes, num, get_spam): + global _top_spam, _top_ham + if get_spam and _top_spam: return _top_spam + if not get_spam and _top_ham: return _top_ham items = [] try: *************** *** 72,75 **** --- 77,82 ---- for word, info in extractor(bayes): + if info is None: + break if ":" in word: continue *************** *** 89,92 **** --- 96,103 ---- for n, word, info in items[:num]: ret[word]=copy.copy(info) + if get_spam: + _top_spam = ret + else: + _top_ham = ret return ret *************** *** 399,403 **** --- 410,416 ---- msgstore.test_suite_running = False try: + print "Scanning all your good mail and spam for some sanity checks..." num_found = num_looked = 0 + num_without_headers = num_without_body = num_without_html_body = 0 for folder_ids, include_sub in [ (manager.config.filter.watch_folder_ids, manager.config.filter.watch_include_sub), *************** *** 418,422 **** --- 431,442 ---- num_found += 1 print " %s/%s" % (folder.name, message.subject) + headers, body, html_body = message._GetMessageTextParts() + if not headers: num_without_headers += 1 + if not body: num_without_body += 1 + if not html_body: num_without_html_body += 1 + print "Checked %d items, %d non-filterable items found" % (num_looked, num_found) + print "of these items, %d had no headers, %d had no text body and %d had no HTML" % \ + (num_without_headers, num_without_body, num_without_html_body) finally: msgstore.test_suite_running = True *************** *** 428,433 **** try: # restore the plugin config at exit. msgstore.test_suite_running = True - run_filter_tests(manager) run_nonfilter_tests(manager) finally: # Always restore configuration to how we started. --- 448,454 ---- try: # restore the plugin config at exit. msgstore.test_suite_running = True run_nonfilter_tests(manager) + # filtering tests take alot of time - do them last. + run_filter_tests(manager) finally: # Always restore configuration to how we started. From richiehindle at users.sourceforge.net Sun Aug 31 15:11:00 2003 From: richiehindle at users.sourceforge.net (Richie Hindle) Date: Sun Aug 31 17:11:04 2003 Subject: [Spambayes-checkins] spambayes/spambayes storage.py,1.23,1.24 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv28164 Modified Files: storage.py Log Message: Patched the patched patches in open_storage() until "hammiefilter -n" worked again. Index: storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** storage.py 25 Aug 2003 19:08:57 -0000 1.23 --- storage.py 31 Aug 2003 21:10:58 -0000 1.24 *************** *** 63,67 **** return not not val ! import sys from spambayes import classifier from spambayes.Options import options --- 63,67 ---- return not not val ! import sys, types from spambayes import classifier from spambayes.Options import options *************** *** 604,608 **** then a DBDictClassifier is used.""" if useDB: ! if data_source_name.find('::') != -1: db_type, rest = data_source_name.split('::', 1) if _storage_types.has_key(db_type.lower()): --- 604,609 ---- then a DBDictClassifier is used.""" if useDB: ! if (isinstance(data_source_name, types.StringTypes) and ! data_source_name.find('::') != -1): db_type, rest = data_source_name.split('::', 1) if _storage_types.has_key(db_type.lower()): From anadelonbrin at users.sourceforge.net Sun Aug 31 18:25:45 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Aug 31 20:25:48 2003 Subject: [Spambayes-checkins] spambayes WHAT_IS_NEW.txt,1.9,1.10 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv27323 Modified Files: WHAT_IS_NEW.txt Log Message: Fix [ spambayes-Bugs-797782 ] Broken link typo in WHAT_IS_NEW.txt (Hmm. no missing space there...) Index: WHAT_IS_NEW.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/WHAT_IS_NEW.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** WHAT_IS_NEW.txt 30 Aug 2003 08:08:32 -0000 1.9 --- WHAT_IS_NEW.txt 1 Sep 2003 00:25:43 -0000 1.10 *************** *** 156,160 **** A url containing the details of these feature requests can be made by appending the request number to this url: ! http://sourceforge.net/tracker/index.php?func=detail&group_id=61702&atid=498104&aid= --- 156,160 ---- A url containing the details of these feature requests can be made by appending the request number to this url: ! http://sourceforge.net/tracker/index.php?func=detail&group_id=61702&atid=498106&aid= From mhammond at users.sourceforge.net Sun Aug 31 21:54:14 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Aug 31 23:54:19 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.105,1.106 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv24114 Modified Files: addin.py Log Message: Log a traceback for toolbar errors so I know exactly what failed. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** addin.py 27 Aug 2003 12:31:46 -0000 1.105 --- addin.py 1 Sep 2003 03:54:12 -0000 1.106 *************** *** 897,900 **** --- 897,901 ---- # eg, bug [ 755738 ] Latest CVS outllok doesn't work print "FAILED to add the toolbar item '%s' - %s" % (tag,e) + traceback.print_exc() return if image_fname: From anadelonbrin at users.sourceforge.net Sun Aug 31 23:06:39 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Sep 1 01:06:43 2003 Subject: [Spambayes-checkins] spambayes smtpproxy.py,1.12,1.13 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv2110 Modified Files: smtpproxy.py Log Message: Suggested fix for [ 797316 ] Extra CRLF to smtp server causes garbage error. Also remove a couple of debugging prints that snuck in. Index: smtpproxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/smtpproxy.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** smtpproxy.py 28 Aug 2003 08:56:57 -0000 1.12 --- smtpproxy.py 1 Sep 2003 05:06:37 -0000 1.13 *************** *** 223,227 **** self.data = "" if self.blockData == False: ! self.serverSocket.push(cooked + '\r\n') else: self.push("250 OK\r\n") --- 223,227 ---- self.data = "" if self.blockData == False: ! self.serverSocket.push(cooked) else: self.push("250 OK\r\n") *************** *** 230,235 **** if cooked is not None: self.serverSocket.push(cooked + '\r\n') - print "pulled: '%s'" % self.request - print "pushed: '%s'" % cooked self.command = self.args = self.request = '' --- 230,233 ---- From mhammond at users.sourceforge.net Sun Aug 31 23:34:21 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Sep 1 01:34:26 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs async_processor.py, 1.6, 1.7 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1:/tmp/cvs-serv6048 Modified Files: async_processor.py Log Message: Get the first tick of the progress bar up a little faster, so the user knows the process has started. Index: async_processor.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/async_processor.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** async_processor.py 27 Aug 2003 02:11:38 -0000 1.6 --- async_processor.py 1 Sep 2003 05:34:19 -0000 1.7 *************** *** 30,34 **** self.processor = processor self.stopping = False ! self.total_control_ticks = 100 self.current_stage = 0 self.set_stages( (("", 1.0),) ) --- 30,34 ---- self.processor = processor self.stopping = False ! self.total_control_ticks = 40 self.current_stage = 0 self.set_stages( (("", 1.0),) ) *************** *** 72,77 **** stage_name, start, prop = self._get_current_stage() total_prop = start + this_prop * prop ! # How may ticks is this on the control ! control_tick = int(total_prop * self.total_control_ticks) #print "Tick", self.current_stage_tick, "is", this_prop, "through the stage,", total_prop, "through the total - ctrl tick is", control_tick while self.current_control_tick < control_tick: --- 72,78 ---- stage_name, start, prop = self._get_current_stage() total_prop = start + this_prop * prop ! # How may ticks is this on the control (but always have 1, so the ! # user knows the process has actually started.) ! control_tick = max(1,int(total_prop * self.total_control_ticks)) #print "Tick", self.current_stage_tick, "is", this_prop, "through the stage,", total_prop, "through the total - ctrl tick is", control_tick while self.current_control_tick < control_tick: From mhammond at users.sourceforge.net Sun Aug 31 23:36:01 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Sep 1 01:36:08 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000 tester.py,1.15,1.16 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1:/tmp/cvs-serv6159 Modified Files: tester.py Log Message: Print progress messages as we scan, and when sanity checking how many message don't have HTML, only count multi-part ones. My new code still leaves me with 1000 out of 5000 with no html. Index: tester.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/tester.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tester.py 31 Aug 2003 05:38:52 -0000 1.15 --- tester.py 1 Sep 2003 05:35:58 -0000 1.16 *************** *** 14,17 **** --- 14,19 ---- from time import sleep import copy + import rfc822 + import cStringIO HAM="ham" *************** *** 423,426 **** --- 425,429 ---- # reported. num_looked += 1 + if num_looked % 500 == 0: print " (scanned", num_looked, "messages...)" if not message.IsFilterCandidate() and \ message.msgclass.lower().startswith("ipm.note"): *************** *** 434,438 **** if not headers: num_without_headers += 1 if not body: num_without_body += 1 ! if not html_body: num_without_html_body += 1 print "Checked %d items, %d non-filterable items found" % (num_looked, num_found) --- 437,445 ---- if not headers: num_without_headers += 1 if not body: num_without_body += 1 ! # for HTML, we only check multi-part ! temp_obj = rfc822.Message(cStringIO.StringIO(headers+"\n\n")) ! content_type = temp_obj.get("content-type", '') ! if content_type.lower().startswith("multipart"): ! if not html_body: num_without_html_body += 1 print "Checked %d items, %d non-filterable items found" % (num_looked, num_found) From mhammond at users.sourceforge.net Sun Aug 31 23:36:36 2003 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Sep 1 01:36:39 2003 Subject: [Spambayes-checkins] spambayes/Outlook2000/sandbox mapi_driver.py, 1.4, 1.5 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/sandbox In directory sc8-pr-cvs1:/tmp/cvs-serv6348 Modified Files: mapi_driver.py Log Message: save and restore the cwd when logging onto mapi Index: mapi_driver.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/sandbox/mapi_driver.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mapi_driver.py 25 Aug 2003 04:19:37 -0000 1.4 --- mapi_driver.py 1 Sep 2003 05:36:34 -0000 1.5 *************** *** 2,5 **** --- 2,6 ---- # Utilities for our sandbox + import os import pythoncom from win32com.mapi import mapi, mapiutil *************** *** 10,13 **** --- 11,15 ---- class MAPIDriver: def __init__(self, read_only = False): + old_cwd = os.getcwd() mapi.MAPIInitialize(None) logonFlags = (mapi.MAPI_NO_MAIL | *************** *** 20,23 **** --- 22,26 ---- self.mapi_flags = mapi.MAPI_DEFERRED_ERRORS | mapi.MAPI_BEST_ACCESS self.outlook = None + os.chdir(old_cwd) def _GetMAPIFlags(self, mapi_flags = None): From anadelonbrin at users.sourceforge.net Sun Aug 31 23:47:06 2003 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Sep 1 01:47:10 2003 Subject: [Spambayes-checkins] spambayes CHANGELOG.txt, 1.13, 1.14 WHAT_IS_NEW.txt, 1.10, 1.11 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1:/tmp/cvs-serv7616 Modified Files: CHANGELOG.txt WHAT_IS_NEW.txt Log Message: Update for the smtpproxy fix. At least, I hope that was the fix... Also a line that I meant to fill in but forgot, specifying where to find old release notes. Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/CHANGELOG.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CHANGELOG.txt 31 Aug 2003 02:26:25 -0000 1.13 --- CHANGELOG.txt 1 Sep 2003 05:47:04 -0000 1.14 *************** *** 1,4 **** --- 1,5 ---- Alpha Release 5 =============== + Tony Meyer 01/09/2003 Fix for [ 797316 ] Extra CRLF to smtp server causes garbage error. Richie Hindle 31/08/2003 The web UI's Shutdown command, and stopping the pop3proxy_service, now wait for any open proxy connections to finish before exiting the process. Richie Hindle 31/08/2003 X-Spambayes-Exception headers now contain a traceback as well as the exception. Index: WHAT_IS_NEW.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/WHAT_IS_NEW.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** WHAT_IS_NEW.txt 1 Sep 2003 00:25:43 -0000 1.10 --- WHAT_IS_NEW.txt 1 Sep 2003 05:47:04 -0000 1.11 *************** *** 65,68 **** --- 65,71 ---- o You can once again specify local addresses as well as ports for the POP3 proxy to listen on (was broken in 1.0a3 and 1.0a4). + o A bug with the SMTP proxy that would show up in some cases as an + "unrecognised command" error the mail client (particularly Eudora) + was fixed. IMAP Filter *************** *** 108,112 **** If you are transitioning from a version older than 1.0a4, please also read the notes in the previous release notes (accessible from ! <>). o If you were previously using the 'dumbdbm' storage method (you will --- 111,115 ---- If you are transitioning from a version older than 1.0a4, please also read the notes in the previous release notes (accessible from ! ). o If you were previously using the 'dumbdbm' storage method (you will *************** *** 141,145 **** 790406, 788008, 787296, 788002, 780612, 784323, 784296, 780819, 780801, 779049, 765912, 777026, 777165, 693387, 690418, 719586, 769346, 761499, ! 769346, 773452, 765042, 760062, 768162, 768221 A url containing the details of these bugs can be made by appending the --- 144,148 ---- 790406, 788008, 787296, 788002, 780612, 784323, 784296, 780819, 780801, 779049, 765912, 777026, 777165, 693387, 690418, 719586, 769346, 761499, ! 769346, 773452, 765042, 760062, 768162, 768221, 797776, 797316 A url containing the details of these bugs can be made by appending the