summaryrefslogtreecommitdiff
path: root/alot/db/attachment.py
Commit message (Collapse)AuthorAge
* helper: move humanize_size to the only place where it is usedAnton Khirnov2021-01-16
|
* db/attachment: remove pointless call to string_decode()Anton Khirnov2020-04-23
| | | | The value is already a string.
* db/attachment: drop useless call to decode_header()Anton Khirnov2020-02-27
| | | | It is already decoded.
* remove old new-style classes syntaxPatrick Totzke2019-05-27
| | | | | | Python3 only supports "new-style" classes (those extending object), and we don't need to explicitly inherit from this root class any more. See http://pylint-messages.wikidot.com/messages:c1001
* db/attachment: use set_param() instead of recreating a headerDylan Baker2018-08-04
| | | | This is more elegant and efficient way to handle this.
* db: encode Header objects to strDylan Baker2018-08-04
| | | | | | | | | | | In python 3 with the use of Policy objects (other than the Compat32 object which maintains the previous (python 2.x and <=3.2) API) change the way headers work, and the old Header object is no longer used. This is rather convenient in that python now implements many of the rules required for sepcial header types, but it changes the API. This fixes that by encoding the Header objects to strings. Fixes #1289
* Remove old __future__ importsLucas Hoffmann2018-06-19
| | | | They are not needed for python >= 3.0.
* fix saving attachmentsDylan Baker2018-03-14
| | | | | | Attachments are encoded into bytes, but the file we open to write them into was being opened in text mode. That doesn't work. Open the file in bytes mode instead.
* Use absolute_imports from __future__Lucas Hoffmann2017-01-18
|
* db/attachment: remove useless deleteDylan Baker2016-12-27
| | | | | This dict key is deleted, and then promptly replaced. The deletion is useless, the replacement does the same thing.
* db/attachment: replace all caps name with PEP8 like nameDylan Baker2016-12-27
| | | | | Using file_ instead of FILE still avoids shadowing the builtin, but also doesn't stand out so much.
* Clean up importsLucas Hoffmann2016-12-09
| | | | | | - use relative imports if possible - group imports into standard library, third party, and alot modules - sort imports alphabetically
* pep8 fixesPatrick Totzke2015-12-16
|
* use magic on application/octetstream' attachmentsPatrick Totzke2014-11-22
| | | | | | | | Some versions of AppleMail apparently send out attachements with incorrect mimetypes "application/octetstream" (instead of "application/octet-stream"). This patch makes alot use libmagic on the attachments content to determine the actual content type.
* pep8&pyflakes fixesPatrick Totzke2013-07-07
| | | | mostly automatically fixed
* fix maxlength issuePatrick Totzke2012-07-22
| | | | | | this uses a email.header.Header obj for attachments-parts Content-Disposition header to ensure their filename-parameters obey RFC2184
* add copyright statements to all source filesPatrick Totzke2012-06-14
| | | | cf issue #472
* docs: minor fixesPatrick Totzke2012-05-29
| | | | this fixes a few broken links and duplicate module defs in the sphinx docs
* hotfix: forgot parameterPatrick Totzke2012-04-06
| | | | when calling decode_header
* Merge branch '0.3-fix-forward-attach' into stagingPatrick Totzke2012-04-06
|\
| * fix Attachment.get_filenamePatrick Totzke2012-04-05
| | | | | | | | | | | | | | | | previously, If the wrapped email-part did not contain a filename parm in its Content-Disposition, decode_header was called with a None value, which rightfully breaks. This makes Attachment.get_filename return None in this case as mentioned in its docstring
* | introduce Attachment.writePatrick Totzke2012-03-28
|/ | | | | that writes out its content to a given filehandle. this is also used internally for save.
* forgot to add attachments.pyPatrick Totzke2012-03-11