diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-08-03 10:34:17 -0700 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2018-08-04 16:21:31 +0100 |
commit | 5c53edfba561a2ebdca2741c92405dbd69bd469c (patch) | |
tree | 782301df6f09783bcdbafdc7082e04d0f7aa7ea4 /alot | |
parent | 1240eba9cd31e81ea364cdab038685fabb7eab2e (diff) |
db/attachment: use set_param() instead of recreating a header
This is more elegant and efficient way to handle this.
Diffstat (limited to 'alot')
-rw-r--r-- | alot/db/attachment.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/alot/db/attachment.py b/alot/db/attachment.py index 2868ed66..73fbf093 100644 --- a/alot/db/attachment.py +++ b/alot/db/attachment.py @@ -1,10 +1,10 @@ # Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> +# Copyright © 2018 Dylan Baker # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file import os import tempfile import email.charset as charset -from email.header import Header from copy import deepcopy from ..helper import string_decode, humanize_size, guess_mimetype @@ -86,8 +86,5 @@ class Attachment(object): def get_mime_representation(self): """returns mime part that constitutes this attachment""" part = deepcopy(self.part) - part['Content-Disposition'] = Header( - self.part['Content-Disposition'], - maxlinelen=78, - header_name='Content-Disposition').encode() + part.set_param('maxlinelen', '78', header='Content-Disposition') return part |