summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2017-08-19 21:08:53 +0100
committerGitHub <noreply@github.com>2017-08-19 21:08:53 +0100
commit34ffe73c11ed8e33e5be5f127958465c943b264d (patch)
tree4f364cc78530653afea7abd0f73c1503babeb669 /alot
parent3d5345d031df7c6db1df6894b7d2f519109efd31 (diff)
parentfa2a442c6d6bbc543fd341fe29d36031e6c71ce3 (diff)
Merge pull request #1127 from lucc/simplify
Simplify for loop and string building
Diffstat (limited to 'alot')
-rw-r--r--alot/buffers.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/alot/buffers.py b/alot/buffers.py
index 6641bd2e..db122aef 100644
--- a/alot/buffers.py
+++ b/alot/buffers.py
@@ -167,15 +167,11 @@ class EnvelopeBuffer(Buffer):
description += ', with key '
elif len(encrypt_keys) > 1:
description += ', with keys '
- first_key = True
+ key_ids = []
for key in encrypt_keys:
- if key is not None:
- if first_key:
- first_key = False
- else:
- description += ', '
- if len(key.subkeys) > 0:
- description += key.uids[0].uid
+ if key is not None and key.subkeys:
+ key_ids.append(key.uids[0].uid)
+ description += ', '.join(key_ids)
lines.append(('GPG encrypt', description))
if self.envelope.tags: