[Spambayes-checkins] spambayes/Outlook2000/dialogs AsyncDialog.py,1.1,1.2 ClassifyDialog.py,1.1,1.2 FilterDialog.py,1.1,1.2 FolderSelector.py,1.1,1.2 RuleDialog.py,1.1,1.2 TrainingDialog.py,1.1,1.2 __init__.py,1.1,1.2

Tim Peters tim_one@users.sourceforge.net
Sat, 19 Oct 2002 11:14:04 -0700


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

Modified Files:
	AsyncDialog.py ClassifyDialog.py FilterDialog.py 
	FolderSelector.py RuleDialog.py TrainingDialog.py __init__.py 
Log Message:
Whitespace normalization.


Index: AsyncDialog.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/AsyncDialog.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AsyncDialog.py	19 Oct 2002 16:24:13 -0000	1.1
--- AsyncDialog.py	19 Oct 2002 18:14:01 -0000	1.2
***************
*** 93,118 ****
  
      def StartProcess(self):
!             if self.running:
!                 self.progress.request_stop()
!             else:
!                 for id in self.disable_while_running_ids:
!                     self.GetDlgItem(id).EnableWindow(0)
!                 self.SetDlgItemText(IDC_START, self.process_stop_text)
!                 self.SetDlgItemText(IDC_PROGRESS_TEXT, "")
!                 self.GetDlgItem(IDC_PROGRESS).ShowWindow(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
!                         self._DoProcess()
!                     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.GetSafeHwnd(), _Progress(self)))
!                 t.start()
--- 93,118 ----
  
      def StartProcess(self):
!         if self.running:
!             self.progress.request_stop()
!         else:
!             for id in self.disable_while_running_ids:
!                 self.GetDlgItem(id).EnableWindow(0)
!             self.SetDlgItemText(IDC_START, self.process_stop_text)
!             self.SetDlgItemText(IDC_PROGRESS_TEXT, "")
!             self.GetDlgItem(IDC_PROGRESS).ShowWindow(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
!                     self._DoProcess()
!                 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.GetSafeHwnd(), _Progress(self)))
!             t.start()

Index: ClassifyDialog.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/ClassifyDialog.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ClassifyDialog.py	19 Oct 2002 16:24:13 -0000	1.1
--- ClassifyDialog.py	19 Oct 2002 18:14:01 -0000	1.2
***************
*** 32,36 ****
          [STATIC,          info_text,            -1,                   (  7,  6, 227,  16), cs ],
          [STATIC,          classify_text,        -1,                   (  7, 29, 131,  11), cs ],
!         
          [STATIC,          "",                   IDC_STATIC_FOLDERS,   (  7,  40, 167,  12), cs | win32con.SS_SUNKEN | win32con.SS_LEFTNOWORDWRAP | win32con.SS_CENTERIMAGE],
          [BUTTON,          '&Browse',            IDC_BROWSE,           (184,  40,  50,  14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP],
--- 32,36 ----
          [STATIC,          info_text,            -1,                   (  7,  6, 227,  16), cs ],
          [STATIC,          classify_text,        -1,                   (  7, 29, 131,  11), cs ],
! 
          [STATIC,          "",                   IDC_STATIC_FOLDERS,   (  7,  40, 167,  12), cs | win32con.SS_SUNKEN | win32con.SS_LEFTNOWORDWRAP | win32con.SS_CENTERIMAGE],
          [BUTTON,          '&Browse',            IDC_BROWSE,           (184,  40,  50,  14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP],
***************
*** 44,48 ****
  
          [BUTTON,          'Close',              win32con.IDOK,        (184, 109,  50,  14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP],
!         
      ]
      disable_while_running_ids = [IDC_FIELDNAME, IDC_BROWSE, win32con.IDOK]
--- 44,48 ----
  
          [BUTTON,          'Close',              win32con.IDOK,        (184, 109,  50,  14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP],
! 
      ]
      disable_while_running_ids = [IDC_FIELDNAME, IDC_BROWSE, win32con.IDOK]

Index: FilterDialog.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FilterDialog.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FilterDialog.py	19 Oct 2002 16:24:13 -0000	1.1
--- FilterDialog.py	19 Oct 2002 18:14:01 -0000	1.2
***************
*** 31,35 ****
              parent.HookCommand(self.OnButAdd, idc_add)
              self.butAdd = parent.GetDlgItem(idc_add)
!     
          if idc_remove is None: self.butRemove = None
          else:
--- 31,35 ----
              parent.HookCommand(self.OnButAdd, idc_add)
              self.butAdd = parent.GetDlgItem(idc_add)
! 
          if idc_remove is None: self.butRemove = None
          else:
***************
*** 40,44 ****
              parent.HookCommand(self.OnButEdit, idc_edit)
              self.butEdit = parent.GetDlgItem(idc_edit)
!         
          self.Refresh()
  
--- 40,44 ----
              parent.HookCommand(self.OnButEdit, idc_edit)
              self.butEdit = parent.GetDlgItem(idc_edit)
! 
          self.Refresh()
  
***************
*** 142,146 ****
              self.SyncEnabledStates()
              index = self.GetSelectedRuleIndex()
!             
              rule = copy.copy(self.rules[index])
              d = RuleDialog.RuleDialog(rule, self.parent.mgr)
--- 142,146 ----
              self.SyncEnabledStates()
              index = self.GetSelectedRuleIndex()
! 
              rule = copy.copy(self.rules[index])
              d = RuleDialog.RuleDialog(rule, self.parent.mgr)
***************
*** 175,179 ****
          [BUTTON,          "&Edit...",           IDC_BUT_EDIT,        ( 179,151,  50,  14), cs | win32con.WS_TABSTOP | win32con.WS_DISABLED],
          ["SysTreeView32", None,                 IDC_LIST_RULES,      ( 14,  52, 216,  95), treestyle | win32con.WS_TABSTOP],
!         
          [BUTTON,         '&Filter Now...',      IDC_BUT_FILTERNOW,   (  7, 177,  50,  14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP],
          [BUTTON,         'Close',               win32con.IDOK,       (179, 177,  50,  14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP],
--- 175,179 ----
          [BUTTON,          "&Edit...",           IDC_BUT_EDIT,        ( 179,151,  50,  14), cs | win32con.WS_TABSTOP | win32con.WS_DISABLED],
          ["SysTreeView32", None,                 IDC_LIST_RULES,      ( 14,  52, 216,  95), treestyle | win32con.WS_TABSTOP],
! 
          [BUTTON,         '&Filter Now...',      IDC_BUT_FILTERNOW,   (  7, 177,  50,  14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP],
          [BUTTON,         'Close',               win32con.IDOK,       (179, 177,  50,  14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP],
***************
*** 185,189 ****
          self.filterer = filterer
          dialog.Dialog.__init__(self, self.dt)
!         
      def OnInitDialog(self):
          self.list = RuleList(self, IDC_LIST_RULES, self.mgr.config.rules, self.rule_factory, IDC_BUT_NEW, IDC_BUT_DELETE, IDC_BUT_EDIT)
--- 185,189 ----
          self.filterer = filterer
          dialog.Dialog.__init__(self, self.dt)
! 
      def OnInitDialog(self):
          self.list = RuleList(self, IDC_LIST_RULES, self.mgr.config.rules, self.rule_factory, IDC_BUT_NEW, IDC_BUT_DELETE, IDC_BUT_EDIT)
***************
*** 252,256 ****
          ["msctls_progress32", '',               IDC_PROGRESS,        ( 10, 170, 227,  11), cs | win32con.WS_BORDER],
          [STATIC,          '',                   IDC_PROGRESS_TEXT,   ( 10, 186, 227,  10), cs ],
!         
          [BUTTON,         process_start_text,    IDC_START,           (  7, 200,  60,  14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP],
          [BUTTON,         'Close',               win32con.IDOK,       (187, 200,  50,  14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP],
--- 252,256 ----
          ["msctls_progress32", '',               IDC_PROGRESS,        ( 10, 170, 227,  11), cs | win32con.WS_BORDER],
          [STATIC,          '',                   IDC_PROGRESS_TEXT,   ( 10, 186, 227,  10), cs ],
! 
          [BUTTON,         process_start_text,    IDC_START,           (  7, 200,  60,  14), cs | win32con.BS_PUSHBUTTON | win32con.WS_TABSTOP],
          [BUTTON,         'Close',               win32con.IDOK,       (187, 200,  50,  14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP],
***************
*** 263,267 ****
          self.rule_factory = rule_factory
          AsyncDialogBase.__init__ (self, self.dt)
!         
      def OnInitDialog(self):
          self.list = RuleList(self, IDC_LIST_RULES, self.mgr.config.rules, self.rule_factory)
--- 263,267 ----
          self.rule_factory = rule_factory
          AsyncDialogBase.__init__ (self, self.dt)
! 
      def OnInitDialog(self):
          self.list = RuleList(self, IDC_LIST_RULES, self.mgr.config.rules, self.rule_factory)

Index: FolderSelector.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FolderSelector.py	19 Oct 2002 16:24:13 -0000	1.1
--- FolderSelector.py	19 Oct 2002 18:14:01 -0000	1.2
***************
*** 84,88 ****
          self.next_item_id = 1
          self.item_map = {}
!         
          self.select_desc_noun = desc_noun
          self.select_desc_noun_suffix = desc_noun_suffix
--- 84,88 ----
          self.next_item_id = 1
          self.item_map = {}
! 
          self.select_desc_noun = desc_noun
          self.select_desc_noun_suffix = desc_noun_suffix
***************
*** 157,165 ****
              yield info, spec
              return # single-hit yield.
!             
          for info, spec in self._YieldAllChildren():
!                 checked = (info[1] >> 12) - 1
!                 if checked:
!                     yield info, spec
  
      def OnInitDialog (self):
--- 157,165 ----
              yield info, spec
              return # single-hit yield.
! 
          for info, spec in self._YieldAllChildren():
!             checked = (info[1] >> 12) - 1
!             if checked:
!                 yield info, spec
  
      def OnInitDialog (self):

Index: RuleDialog.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/RuleDialog.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RuleDialog.py	19 Oct 2002 16:24:13 -0000	1.1
--- RuleDialog.py	19 Oct 2002 18:14:01 -0000	1.2
***************
*** 51,55 ****
          [BUTTON,          "Write spam score to field", IDC_WRITE_FIELD, (11,151,108,  15), csts | win32con.BS_AUTOCHECKBOX],
          [EDIT,            "",                   IDC_FIELD_NAME,      (120, 152,  59,  14), csts | win32con.ES_AUTOHSCROLL | win32con.WS_BORDER],
!         
          [BUTTON,         'OK',                  win32con.IDOK,       (129, 178,  50,  14), csts | win32con.BS_DEFPUSHBUTTON],
          [BUTTON,         'Cancel',              win32con.IDCANCEL,   (192, 178,  50,  14), csts | win32con.BS_PUSHBUTTON],
--- 51,55 ----
          [BUTTON,          "Write spam score to field", IDC_WRITE_FIELD, (11,151,108,  15), csts | win32con.BS_AUTOCHECKBOX],
          [EDIT,            "",                   IDC_FIELD_NAME,      (120, 152,  59,  14), csts | win32con.ES_AUTOHSCROLL | win32con.WS_BORDER],
! 
          [BUTTON,         'OK',                  win32con.IDOK,       (129, 178,  50,  14), csts | win32con.BS_DEFPUSHBUTTON],
          [BUTTON,         'Cancel',              win32con.IDCANCEL,   (192, 178,  50,  14), csts | win32con.BS_PUSHBUTTON],
***************
*** 61,65 ****
          self.folder_id = rule.folder_id
          dialog.Dialog.__init__ (self, self.dt)
!         
      def OnInitDialog(self):
          rule = self.rule
--- 61,65 ----
          self.folder_id = rule.folder_id
          dialog.Dialog.__init__ (self, self.dt)
! 
      def OnInitDialog(self):
          rule = self.rule
***************
*** 72,76 ****
          edit.SetWindowText(rule.write_field_name)
          edit.EnableWindow(rule.write_field)
!         
          self._InitSlider(IDC_SLIDER_HIGH, IDC_EDIT_HIGH)
          self._InitSlider(IDC_SLIDER_LOW, IDC_EDIT_LOW)
--- 72,76 ----
          edit.SetWindowText(rule.write_field_name)
          edit.EnableWindow(rule.write_field)
! 
          self._InitSlider(IDC_SLIDER_HIGH, IDC_EDIT_HIGH)
          self._InitSlider(IDC_SLIDER_LOW, IDC_EDIT_LOW)
***************
*** 140,144 ****
              idc_edit = IDC_EDIT_LOW
          self.SetDlgItemText(idc_edit, "%.2f" % (slider.GetPos() / 100.0))
!         
      def _InitSlider(self, idc_slider, idc_edit):
          slider = self.GetDlgItem(idc_slider)
--- 140,144 ----
              idc_edit = IDC_EDIT_LOW
          self.SetDlgItemText(idc_edit, "%.2f" % (slider.GetPos() / 100.0))
! 
      def _InitSlider(self, idc_slider, idc_edit):
          slider = self.GetDlgItem(idc_slider)
***************
*** 168,172 ****
          setattr(rule, attr, val)
          return True
!         
      def OnOK(self):
          rule = self.rule
--- 168,172 ----
          setattr(rule, attr, val)
          return True
! 
      def OnOK(self):
          rule = self.rule
***************
*** 213,217 ****
      mgr = Manager()
      mgr.mapi = mapi
!             
  
      rule = Rule()
--- 213,217 ----
      mgr = Manager()
      mgr.mapi = mapi
! 
  
      rule = Rule()

Index: TrainingDialog.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/TrainingDialog.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrainingDialog.py	19 Oct 2002 16:24:13 -0000	1.1
--- TrainingDialog.py	19 Oct 2002 18:14:01 -0000	1.2
***************
*** 44,48 ****
  
          [BUTTON,          'Close',              win32con.IDOK,        (184,  97,  50,  14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP],
!         
      ]
      disable_while_running_ids = [IDC_BROWSE_HAM, IDC_BROWSE_SPAM, win32con.IDOK]
--- 44,48 ----
  
          [BUTTON,          'Close',              win32con.IDOK,        (184,  97,  50,  14), cs | win32con.BS_DEFPUSHBUTTON | win32con.WS_TABSTOP],
! 
      ]
      disable_while_running_ids = [IDC_BROWSE_HAM, IDC_BROWSE_SPAM, win32con.IDOK]
***************
*** 102,106 ****
          finally:
              self.mgr.WorkerThreadEnding()
!             
  ##if __name__=='__main__':
  ##    d=TrainingDialog(None)
--- 102,106 ----
          finally:
              self.mgr.WorkerThreadEnding()
! 
  ##if __name__=='__main__':
  ##    d=TrainingDialog(None)

Index: __init__.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/__init__.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** __init__.py	19 Oct 2002 16:24:13 -0000	1.1
--- __init__.py	19 Oct 2002 18:14:01 -0000	1.2
***************
*** 1,2 ****
! # This package defines dialog boxes used by the main 
  # SpamBayes Outlook 2k integration code.
--- 1,2 ----
! # This package defines dialog boxes used by the main
  # SpamBayes Outlook 2k integration code.