summaryrefslogtreecommitdiff
path: root/alot/db/thread.py
Commit message (Collapse)AuthorAge
* 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
* match addresses against accounts, not address listsvrs2018-12-10
| | | | fixes #1230, fixes an unfiled bug in clear_my_address()
* Remove old __future__ importsLucas Hoffmann2018-06-19
| | | | They are not needed for python >= 3.0.
* repalces uses of dict.iter* with non-iter versionsDylan Baker2018-03-01
| | | | | | | in python3 dict.{keys,items,values} return views, which are similar to iterators without some of the caveats about modifying the underlying object. The iter* and view* methods have been removed, instead one warps dict.x in iter or list to get those types.
* py3k: Use build in next functionLucas Hoffmann2017-08-20
|
* settings: do not store SettingsManager instance in __init__.pyDylan Baker2017-08-03
| | | | | | | This can create circular imports in unittests, which causes difficult to debug errors. Fixes #1076
* Use absolute_imports from __future__Lucas Hoffmann2017-01-18
|
* Use dict's iter methodsDylan Baker2016-12-21
| | | | | | | | This patch replaces a number of uses of dict.items, dict.values, and dict.keys with their iterative siblings. The advantage of using the iterator version is that they don't copy the keys, values, or items, but simply return references. This reduces memory usage and may speed up the these operations a bit.
* db/thread: Set some protected variables in the constructor.Dylan Baker2016-12-21
|
* db/thread: Avoid intermediate data structureDylan Baker2016-12-21
| | | | | | This patch removes the need to create an intermediate dictionary while calculating the authors of a thread, it does so by working directly with the _authors list.
* db/thread: don't create multiple lists to sortDylan Baker2016-12-21
| | | | | | | | | | | | | | | Currently this function takes a list, splits into two lists based on whether or not a function returns None, sorts the list that isn't None, and then appends the list of None to the end. This creates 4 new concrete lists on each method call, requires the use of 3 filter + lambda pairs, and calls list.sort(). Pretty complicated and inefficient. This patch replaces that with a single sorted() function call with a kay function that replaces None with a value that is guaranteed to sort less than what Message.get_date() will return, but will not cause a comparison to None (which is an error in Python 3.x). This is all based on iterators and avoids the need for filter or list concatenation. This should result in only one new list being created.
* tests: Add tests for alot.db.thread.Thread.get_authorDylan Baker2016-12-21
|
* db/thread: define Thread._authors in constructorDylan Baker2016-12-21
| | | | This is needed by unittest that mock Thread.refresh.
* 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.
* Clean up importsLucas Hoffmann2016-12-09
| | | | | | - use relative imports if possible - group imports into standard library, third party, and alot modules - sort imports alphabetically
* 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.
* pep8 fixesPatrick Totzke2015-12-16
|
* Allow configuring what does alot consider to be the thread subject.Anton Khirnov2015-12-16
|
* fix 544Patrick Totzke2013-01-15
| | | | | only sort messages with not-None date header, append the rest
* 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
* pep8 fixesPatrick Totzke2012-03-15
|
* docs: corrected pointers to db.message.MessagePatrick Totzke2012-03-11
|
* refactor db: move into submodulePatrick Totzke2012-03-11
this moves messages into the new submodule alot.db which from now on also contains Threads in a separate file