Merge branch 'ss/debug-folderfilter' into next

This commit is contained in:
Nicolas Sebrecht 2011-03-03 19:07:35 +01:00
commit c9ac254c8c
2 changed files with 5 additions and 1 deletions

View File

@ -23,6 +23,7 @@ from offlineimap.ui import getglobalui
class BaseRepository(CustomConfig.ConfigHelperMixin):
def __init__(self, reposname, account):
self.ui = getglobalui()
self.account = account
self.config = account.getconfig()
self.name = reposname
@ -144,7 +145,7 @@ class BaseRepository(CustomConfig.ConfigHelperMixin):
except (KeyboardInterrupt):
raise
except:
getglobalui().warn("ERROR Attempting to create folder " \
self.ui.warn("ERROR Attempting to create folder " \
+ key + ":" +traceback.format_exc())
#

View File

@ -27,6 +27,7 @@ class IMAPRepository(BaseRepository):
def __init__(self, reposname, account):
"""Initialize an IMAPRepository object."""
BaseRepository.__init__(self, reposname, account)
# self.ui is being set by the BaseRepository
self.imapserver = imapserver.ConfigedIMAPServer(self)
self.folders = None
self.nametrans = lambda foldername: foldername
@ -250,6 +251,8 @@ class IMAPRepository(BaseRepository):
continue
foldername = imaputil.dequote(name)
if not self.folderfilter(foldername):
self.ui.debug('imap',"Filtering out '%s' due to folderfilter" %\
foldername)
continue
retval.append(self.getfoldertype()(self.imapserver, foldername,
self.nametrans(foldername),