[Spambayes-checkins] spambayes/Outlook2000/dialogs ManagerDialog.py,1.6,1.7

Mark Hammond mhammond@users.sourceforge.net
Thu Nov 7 02:54:18 2002


Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs
In directory usw-pr-cvs1:/tmp/cvs-serv18380/dialogs

Modified Files:
	ManagerDialog.py 
Log Message:
As per report on mailing list, don't insist on an "Unsure" folder before
filtering can be enabled.  Also wrapped a few long lines.


Index: ManagerDialog.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/ManagerDialog.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ManagerDialog.py	5 Nov 2002 21:51:53 -0000	1.6
--- ManagerDialog.py	7 Nov 2002 02:54:16 -0000	1.7
***************
*** 69,74 ****
          self.checkbox_items = [
              (IDC_BUT_FILTER_ENABLE, "self.mgr.config.filter.enabled"),
!             (IDC_BUT_TRAIN_FROM_SPAM_FOLDER, "self.mgr.config.training.train_recovered_spam"),
!             (IDC_BUT_TRAIN_TO_SPAM_FOLDER, "self.mgr.config.training.train_manual_spam"),
          ]
  
--- 69,76 ----
          self.checkbox_items = [
              (IDC_BUT_FILTER_ENABLE, "self.mgr.config.filter.enabled"),
!             (IDC_BUT_TRAIN_FROM_SPAM_FOLDER,
!                      "self.mgr.config.training.train_recovered_spam"),
!             (IDC_BUT_TRAIN_TO_SPAM_FOLDER,
!                      "self.mgr.config.training.train_manual_spam"),
          ]
  
***************
*** 105,114 ****
          ok_to_enable = operator.truth(config.watch_folder_ids)
          if not ok_to_enable:
!             filter_status = "You must define folders to watch for new messages"
          if ok_to_enable:
              ok_to_enable = nspam >= min_spam and nham >= min_ham
              if not ok_to_enable:
!                 filter_status = "There must be %d good and %d spam messages\n" \
!                                 "trained before filtering can be enabled" \
                                  % (min_ham, min_spam)
          if ok_to_enable:
--- 107,118 ----
          ok_to_enable = operator.truth(config.watch_folder_ids)
          if not ok_to_enable:
!             filter_status = "You must define folders to watch "\
!                             "for new messages"
          if ok_to_enable:
              ok_to_enable = nspam >= min_spam and nham >= min_ham
              if not ok_to_enable:
!                 filter_status = "There must be %d good and %d spam  " \
!                                 "messages\ntrained before filtering " \
!                                 "can be enabled" \
                                  % (min_ham, min_spam)
          if ok_to_enable:
***************
*** 116,137 ****
              ok_to_enable = operator.truth(config.spam_folder_id)
              if ok_to_enable:
!                 certain_spam_name = self.mgr.FormatFolderNames([config.spam_folder_id], False)
!                 ok_to_enable = operator.truth(config.unsure_folder_id)
!                 if ok_to_enable:
!                     unsure_name = self.mgr.FormatFolderNames([config.unsure_folder_id], False)
                  else:
!                     filter_status = "You must define the folder to receive your possible spam"
              else:
!                 filter_status = "You must define the folder to receive your certain spam"
!                 
              # whew
              if ok_to_enable:
!                 watch_names = self.mgr.FormatFolderNames(config.watch_folder_ids, config.watch_include_sub)
!                 filter_status = "Watching '%s'. Spam managed in '%s', unsure managed in '%s'" \
!                                 % (watch_names, certain_spam_name, unsure_name)
  
          self.GetDlgItem(IDC_BUT_FILTER_ENABLE).EnableWindow(ok_to_enable)
          enabled = config.enabled
!         self.GetDlgItem(IDC_BUT_FILTER_ENABLE).SetCheck(ok_to_enable and enabled)
          self.SetDlgItemText(IDC_FILTER_STATUS, filter_status)
  
--- 120,148 ----
              ok_to_enable = operator.truth(config.spam_folder_id)
              if ok_to_enable:
!                 certain_spam_name = self.mgr.FormatFolderNames(
!                                         [config.spam_folder_id], False)
!                 if config.unsure_folder_id:
!                     unsure_name = self.mgr.FormatFolderNames(
!                                         [config.unsure_folder_id], False)
!                     unsure_text = "unsure managed in '%s'" % (unsure_name,)
                  else:
!                     unsure_text = "unsure messages untouched"
              else:
!                 filter_status = "You must define the folder to " \
!                                 "receive your certain spam"
! 
              # whew
              if ok_to_enable:
!                 watch_names = self.mgr.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)
  
          self.GetDlgItem(IDC_BUT_FILTER_ENABLE).EnableWindow(ok_to_enable)
          enabled = config.enabled
!         self.GetDlgItem(IDC_BUT_FILTER_ENABLE).SetCheck(
!                                                 ok_to_enable and enabled)
          self.SetDlgItemText(IDC_FILTER_STATUS, filter_status)
  
***************
*** 139,143 ****
          if code == win32con.BN_CLICKED:
  
!             fname = os.path.join(os.path.dirname(__file__), os.pardir, "about.html")
              fname = os.path.abspath(fname)
              print fname
--- 150,156 ----
          if code == win32con.BN_CLICKED:
  
!             fname = os.path.join(os.path.dirname(__file__),
!                                  os.pardir,
!                                  "about.html")
              fname = os.path.abspath(fname)
              print fname