Add filter information to --info output

Prettify the folder listing in --info and add the "filtered" information
to it.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2012-01-07 21:17:36 +01:00
parent e267dcd24d
commit 241e8f838b
2 changed files with 11 additions and 5 deletions

View File

@ -16,6 +16,8 @@ New Features
Changes Changes
------- -------
* Add folderfilter information to the --info output
Bug Fixes Bug Fixes
--------- ---------

View File

@ -386,12 +386,16 @@ class UIBase(object):
self._msg("nametrans= %s\n" % nametrans) self._msg("nametrans= %s\n" % nametrans)
folders = repository.getfolders() folders = repository.getfolders()
foldernames = [(f.name, f.getvisiblename()) for f in folders] foldernames = [(f.name, f.getvisiblename(), f.sync_this) \
for f in folders]
folders = [] folders = []
for name, visiblename in foldernames: for name, visiblename, sync_this in foldernames:
if name == visiblename: folders.append(name) syncstr = "" if sync_this else " (disabled)"
else: folders.append("%s -> %s" % (name, visiblename)) if name == visiblename: folders.append("%s%s" % (name,
self._msg("Folderlist: %s\n" % str(folders)) syncstr))
else: folders.append("%s -> %s%s" % (name,
visiblename, syncstr))
self._msg("Folderlist:\n %s\n" % "\n ".join(folders))
finally: finally:
if conn: #release any existing IMAP connection if conn: #release any existing IMAP connection
repository.imapserver.close() repository.imapserver.close()