imapserver: change lambdas with map to list comprehension
It is more readable and returns a list.
This continues work done in 19c4330
.
Signed-off-by: Łukasz Żarnowiecki <dolohow@outlook.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
cbd1a8929a
commit
48611398e0
@ -426,17 +426,12 @@ class IMAPServer(object):
|
|||||||
exc_stack.append((m, e))
|
exc_stack.append((m, e))
|
||||||
|
|
||||||
if len(exc_stack):
|
if len(exc_stack):
|
||||||
msg = "\n\t".join(map(
|
msg = "\n\t".join([": ".join((x[0], str(x[1]))) for x in exc_stack])
|
||||||
lambda x: ": ".join((x[0], str(x[1]))),
|
|
||||||
exc_stack
|
|
||||||
))
|
|
||||||
raise OfflineImapError("All authentication types "
|
raise OfflineImapError("All authentication types "
|
||||||
"failed:\n\t%s"% msg, OfflineImapError.ERROR.REPO)
|
"failed:\n\t%s"% msg, OfflineImapError.ERROR.REPO)
|
||||||
|
|
||||||
if not tried_to_authn:
|
if not tried_to_authn:
|
||||||
methods = ", ".join(map(
|
methods = ", ".join([x[5:] for x in [x for x in imapobj.capabilities if x[0:5] == "AUTH="]])
|
||||||
lambda x: x[5:], [x for x in imapobj.capabilities if x[0:5] == "AUTH="]
|
|
||||||
))
|
|
||||||
raise OfflineImapError(u"Repository %s: no supported "
|
raise OfflineImapError(u"Repository %s: no supported "
|
||||||
"authentication mechanisms found; configured %s, "
|
"authentication mechanisms found; configured %s, "
|
||||||
"server advertises %s"% (self.repos,
|
"server advertises %s"% (self.repos,
|
||||||
|
Loading…
Reference in New Issue
Block a user