summaryrefslogtreecommitdiff
path: root/alot/db
Commit message (Collapse)AuthorAge
* db/thread: define Thread._authors in constructorDylan Baker2016-12-21
| | | | This is needed by unittest that mock Thread.refresh.
* Drop little used helperDylan Baker2016-12-19
| | | | | | | | The safely_get helper is just a wrapper around try/except, and is used twice in the whole code base, in the same function. It really doesn't even end up saving code because to get around line wrapping a lambda is assigned (which is not the greatest style wise), it ends up saving one line of code when it's called, and the function itself is 16 lines long.
* Use with blocks to write to temp filesLucas Hoffmann2016-12-18
|
* use open() as context managerDylan Baker2016-12-14
| | | | | | | | | | This uses open() as a context manager instead of calling close() explicitly. This has the advantage of closing even in the event of an exception, being easier to visually inspect for correctness, and being the more modern idiom. This does leave one case of file.close(), where FILE is opened in an if tree.
* Don't pass None as second argument of dict.get()Dylan Baker2016-12-13
| | | | This is the default value.
* Replace list comprehension with set comprehensionDylan Baker2016-12-13
| | | | | | | Instead of using set([l for l in list]) use {l for l in list} (which shouldn't be confused with a dict comprehension which requires the ':' in the first value}. This avoids creating a list before reducing it to a set. This feature is new in 2.7 and 3.3.
* Replace mutable keyword argumentsDylan Baker2016-12-13
| | | | | | | | | | | | | | | | | | | | | | | There are a number of cases of mutable keyword arguments (list and dict in this case). Mutable keyword arguments are rather dangerous, since any mutation of the default value is persistent, which will inevitably lead to bugs. For example, imagine this code: def func(def=[]): def.append('foo') return def >>> func() ['foo'] >>> func() ['foo', 'foo'] This is almost certainly not what was intended. This code generally uses the idiom of setting the default value to None, and then assigning with or `value = value or []` which will replace value with the empty list (or dict) when value is falsey, like None or another empty list.
* Further minor style fixesLucas Hoffmann2016-12-09
|
* Clean up importsLucas Hoffmann2016-12-09
| | | | | | - use relative imports if possible - group imports into standard library, third party, and alot modules - sort imports alphabetically
* Use logging's native string interpolationLucas Hoffmann2016-12-09
|
* Remove braces after `del` and `return`Lucas Hoffmann2016-12-09
| | | | | `del` and `return` are keywords and not functions so the braces are not needed.
* New option `thread_authors_order_by` to control author orderTommy Lindgren2016-12-06
| | | | | | | | | | | | | Default value 'first_message' lists authors in the order they joined the conversation. Value 'latest_message' order authors by their latest message, which makes it easier to see which authors who wrote the most recent messages. Note that authors with duplicate emails were previously filtered. We now keep all authors where name + email is unique. This is behavior is desired for some email notification services. For example, Jira will set the From header to "Joe User <jira@company.com>" meaning you will only see one author if you only keep unique email addresses.
* Merge pull request #752 from jkoelker/pipeto_field_keyPatrick Totzke2016-12-06
|\ | | | | Allow specifing the mailcap field key for `pipeto`
| * Allow specifing the mailcap field key for `pipeto`Jason Kölker2015-02-11
| | | | | | | | | | When decoding the message, use the mailcap field specified for command lookup.
* | Merge pull request #901 from xunam/fix-backslash-tPatrick Totzke2016-12-06
|\ \ | | | | | | Removed incorrect backslash-t substitution in envelope.
| * | Removed incorrect backslash-t substitution in envelope.Emmanuel Beffara2016-10-20
| | |
* | | Merge branch '0.3.8-feature-untrusted-signatures-858'Patrick Totzke2016-12-06
|\ \ \ | |/ / |/| |
| * | Define local var in all code paths.Lucas Hoffmann2016-03-30
| | |
| * | Indicate untrusted PGP signatures in thread view.Lucas Hoffmann2016-03-24
| | |
* | | fix #891Patrick Totzke2016-10-19
|/ /
* | pep8 fixesPatrick Totzke2015-12-16
| |
* | Allow configuring what does alot consider to be the thread subject.Anton Khirnov2015-12-16
| |
* | remove deprecated methodPatrick Totzke2015-11-24
|/ | | | see also issue #794
* fix regex for unquoting in decode_headerTomas Tomecek2015-01-08
| | | | issue #539
* 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.
* just formating (pep8 etc.)Patrick Totzke2014-08-02
|
* Move email_as_string function from crypto to helper moduleYann Rouillard2014-08-02
| | | | | | | | | The email_as_string function, and the related RFC3156_canonicalize function, are now used by the ForwardCommand and are not specific anymore to the crypto routine. So we move them to the global helper module. fix an import removal mistake while moving email_as_string function: StringIO was not only used by email_as_string
* ensure that Envelope.body is unicode stringPatrick Totzke2014-03-21
|
* add mailto-helperPatrick Totzke2013-12-01
|
* db.utils: Use unicode for GPG error messagesSimon Chopin2013-08-13
| | | | | This patch makes the use of unicode more consistent, and enforces the UTF8 charset for the added payload in case of failure.
* Use Unicode strings when dealing with GPGSimon Chopin2013-07-24
| | | | | This delays the encoding of special chars, if any, to the actual display which is supposed to know into what it should be encoded.
* pep8&pyflakes fixesPatrick Totzke2013-07-07
| | | | mostly automatically fixed
* adjust error messagePatrick Totzke2013-07-07
|
* move check to add_message directlyPatrick Totzke2013-07-07
|
* raise exception when adding msg no non-indexable pathPatrick Totzke2013-07-07
| | | | i.e., one not below that of notmuch's root path
* add helper to check if path is below anotherPatrick Totzke2013-07-07
| | | | this is used in the Database manager
* Fix the default failobj of get_paramsJustus Winter2013-06-20
| | | | | | | | | Formerly None was used as failobj, but None is not iterable and that is all that get_params does. Use list() instead which is iterable. Closes #626. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* Tune the parsing of RFC 3156 style mailsJustus Winter2013-06-16
| | | | | | | | | Formerly any SMIME signed mail triggered a malformed OpenPGP message warning. Be more selective wrt what to interpret as OpenPGP data by looking at the protocol parameter first. Includes minor stylistic changes. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* Fix detection of OpenPGP encrypted dataJustus Winter2013-06-16
| | | | | | | Fix detection of OpenPGP encrypted data and also check the 'protocol' parameter. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* Move the parameter extraction to its own functionJustus Winter2013-06-16
| | | | | | | Move the parameter extraction to its own function and generalize it so it can be reused. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* Normalize Content-Type parametersJustus Winter2013-06-16
| | | | | | | RFC 2045 specifies that parameter names are case-insensitive, so normalize them by converting them to their lower case version. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* Handle missing parameters gracefullyJustus Winter2013-06-16
| | | | | | | | | OpenPGP states that the Content-Type header is annotated with parameters, namely 'protocol' and 'micalg'. Use .get() to retrieve this values with a default value to handle the case of malformed (according to RFC 3156) messages gracefully. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* Parse and decrypt OpenPGP encrypted dataJustus Winter2013-06-16
| | | | | | | | | Parse and decrypt OpenPGP encrypted data as specified by RFC 3156. If such a message is detected and found to be well-formed, it is decrypted and any MIME messages found within the plain text are attached to the original message. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* Verify OpenPGP signatures and display the resultJustus Winter2013-06-16
| | | | | | | Verify OpenPGP signatures as specified in RFC 3156. Display the result in the header list above the message. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* doc: fix Envelope.attachments docstringPatrick Totzke2013-06-02
|
* fix incorrect instanciations of GPGProblemPatrick Totzke2013-04-06
| | | | | with missing 'code' parameter. cf issue #590
* fix 'attach' pseudo headerPatrick Totzke2013-04-02
| | | | | | | this feature was not yet changed after an Envelope rewrite and was still based on Envelope._headers[foo] being a str and not a list of str. fixes #587
* respect mailcap commands that expect stdinPatrick Totzke2013-03-20
| | | | | | | | This ensures that we respect if a command as specified per mailcap expects its input via stdin and not per tempfile. This was already done for opening of attachments but not for interpreting non-text/plain message parts. fix #584
* pep8/pyflakes fixesPatrick Totzke2013-03-16
|
* fix #575Patrick Totzke2013-02-27
|