From 93f7d0bd1f31f5ce6b4dd6de8145a3a06996ade1 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 3 Mar 2011 11:43:23 +0100 Subject: [PATCH] Enable debug output to see what folderfilter actually filters out It is currently very hard to find out what folderfilter actually does and makes it hard to debug for a user. With this patch if the user has enabled "-d imap" (even better would perhaps be a different debug type for this kind of thing?), we see a message "Filtering out folder 'foo' due to folderfilter" in the logs. Signed-off-by: Sebastian Spaeth Signed-off-by: Nicolas Sebrecht --- offlineimap/repository/IMAP.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 3bfa5db..76ff2c9 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -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),