[Spambayes-checkins] spambayes/Outlook2000/dialogs
FolderSelector.py, 1.36, 1.36.4.1
Tony Meyer
anadelonbrin at users.sourceforge.net
Thu Jun 10 00:57:14 EDT 2004
Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12423/Outlook2000/dialogs
Modified Files:
Tag: release_1_0-branch
FolderSelector.py
Log Message:
Backport fix for [ 943397 ] Cannot choose more than one Inbox folder to filter
(this is Mark's fix of Tony's fix).
Index: FolderSelector.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v
retrieving revision 1.36
retrieving revision 1.36.4.1
diff -C2 -d -r1.36 -r1.36.4.1
*** FolderSelector.py 27 Feb 2004 02:59:51 -0000 1.36
--- FolderSelector.py 10 Jun 2004 04:57:11 -0000 1.36.4.1
***************
*** 6,9 ****
--- 6,10 ----
import win32api
import win32gui
+ import winerror
import struct, array
***************
*** 491,497 ****
folder = self.manager.message_store.GetFolder(spec.folder_id)
parent = folder.GetParent()
! valid = parent is not None and parent.GetParent() is not None
except self.manager.message_store.MsgStoreException, details:
! print "Eeek - couldn't get the folder to check valid"
valid = False
if not valid:
--- 492,525 ----
folder = self.manager.message_store.GetFolder(spec.folder_id)
parent = folder.GetParent()
! try:
! # Psts and the main Exchange store have top level
! # folders with parents (with empty display names),
! # and no grandparents. Anything below the top
! # level *does* have a grandparent. This means our
! # test for "top level folder" can be: does it have
! # a parent *and* grandparent. However, a
! # secondary Exchange account doesn't have the
! # empty-display-name parent, so the top-level
! # doesn't have a parent, and the top selectable
! # folder doesn't have a grandparent, and our test
! # fails. Allow for this by checking for the
! # "Access denied" exception when getting the
! # grandparent, and assuming that this means that
! # this is what is happening. This will only fail
! # if we get an 'access denied' error for the
! # empty-display-name parent, which should not be
! # the case.
! grandparent = parent.GetParent()
! except self.manager.message_store.MsgStoreException, details:
! hr, msg, exc, argErr = details.mapi_exception
! if hr == winerror.E_ACCESSDENIED:
! valid = parent is not None
! else:
! raise # but only down a couple of lines...
! else:
! valid = parent is not None and grandparent is not None
except self.manager.message_store.MsgStoreException, details:
! print "Eeek - couldn't get the folder to check " \
! "valid:", details
valid = False
if not valid:
More information about the Spambayes-checkins
mailing list