diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2011-10-21 09:18:08 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2011-10-21 09:18:08 +0100 |
commit | 0f242e3f0c234a18bc4ff292cbac62dec075b6ea (patch) | |
tree | b74cd1a0a59270434b1533a790c54a1316055b70 /alot | |
parent | 8fb9e35e85cbf6d3c8b66920d726c14a74d9a391 (diff) |
include headers in decoded output
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/thread.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index be0e1588..08dbb8e9 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -18,6 +18,7 @@ from alot import completion from alot import helper from alot.message import encode_header from alot.message import decode_header +from alot.message import extract_headers MODE = 'thread' @@ -285,10 +286,16 @@ class PipeCommand(Command): # prepare message sources mails = [m.get_email() for m in to_print] + mailstrings = [] if self.decode: - #TODO: include header - #TODO: add flag to exclude html - mailstrings = [''.join(body_line_iterator(e, True)) for e in mails] + for mail in mails: + #displayed = settings.config.getstringlist('general', 'displayed_headers') + displayed = mail.keys() + headertext = extract_headers(mail, displayed) + bodytext = ''.join(body_line_iterator(mail, True)) + + #TODO: add flag to exclude html + mailstrings.append('%s\n\n%s' % (headertext, bodytext)) else: mailstrings = [e.as_string() for e in mails] if not self.separately: |