Change filter with lambda to list comprehension

It is more readable and returns a list therefore it is compatible both
with Python 2 and 3.

Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Łukasz Żarnowiecki
2016-05-08 16:55:13 +02:00
committed by Nicolas Sebrecht
parent 068ac7c410
commit 19c43308b9
5 changed files with 11 additions and 17 deletions

View File

@ -131,9 +131,7 @@ class OLITestLib():
else:
sections = [r for r in config.sections() \
if r.startswith('Repository')]
sections = filter(lambda s: \
config.get(s, 'Type').lower() == 'imap',
sections)
sections = [s for s in sections if config.get(s, 'Type').lower() == 'imap']
for sec in sections:
# Connect to each IMAP repo and delete all folders
# matching the folderfilter setting. We only allow basic