Merge branch 'ss/debug-folderfilter' into next
This commit is contained in:
commit
c9ac254c8c
@ -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())
|
||||
|
||||
#
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user