[Spambayes-checkins] spambayes/Outlook2000/dialogs FolderSelector.py, 1.24, 1.25

Mark Hammond mhammond at users.sourceforge.net
Tue Aug 26 22:03:22 EDT 2003


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()





More information about the Spambayes-checkins mailing list