summaryrefslogtreecommitdiff
path: root/alot/db/manager.py
Commit message (Collapse)AuthorAge
* db/manager: support flexible database locationAnton Khirnov2022-02-05
| | | | | In newer notmuch versions it no longer needs to be stored along with the emails themselves.
* db/manager: optimize database modificationsAnton Khirnov2021-03-18
| | | | | | | Add only tags that are not present on the message, remove only tags that are present. Otherwise the no-op modification results in an actual db write, even though nothing changes.
* db/manager: rewrite db write operation APIAnton Khirnov2021-02-07
| | | | Allows to apply multiple operations together as a single unit.
* db/manager: use only one worker thread for write operationsAnton Khirnov2021-02-05
| | | | | There is no point in having more, as the database cannot have more than one writer at any moment.
* buffers/search: fix handling malformed queriesAnton Khirnov2021-01-31
|
* db: use symbolic constants for sort ordersAnton Khirnov2021-01-31
|
* db/manager: handle notmuch exceptions in count_*Anton Khirnov2021-01-30
|
* db/manager: fix signature of Database.add()Anton Khirnov2021-01-24
|
* buffers: make get_info() asynchronousAnton Khirnov2021-01-20
| | | | | Allows computing message/thread counts asynchronously in a separate thread.
* db: make sure to close the read-only database instancesAnton Khirnov2021-01-20
|
* db: make write operations asyncAnton Khirnov2021-01-20
|
* db/manager: drop unused variableAnton Khirnov2021-01-19
|
* db/manager: Drop async methodDylan Baker2021-01-10
| | | | | | | | | | As far as I can tell using a separate process doesn't actually improve performance, it makes it worse. The work that we're passing off to the separate function isn't necessarily work that's well suited to being handed off, there isn't a lot of computation and the objects that need to be passed across the pipe are fairly large (at least when considering a pipe). Converting the function to a generator gives better performance and simplifies the implementation.
* Allow designating certain tags as "property" tags.Anton Khirnov2020-05-24
| | | | | | | | Those are tags like attachment, signed, sent, etc., which are set automatically based on message properties and are typically not changed manually. Such designated tags are not affected by the retag operation.
* Consistently use set/frozenset for tags.Anton Khirnov2020-05-24
|
* Switch to the notmuch2 bindings.Anton Khirnov2020-05-09
| | | | | They are supposed to replace the original notmuch python bindings, providing a safer and more pythonic interface.
* db/manager: change add_message signatureAnton Khirnov2020-05-08
| | | | Remove the unused afterwards callback, make tags mandatory.
* db/manager: drop support for adding/removing queriesAnton Khirnov2020-05-08
| | | | | This is not implemented in notmuch2 and does not really belong in alot. It can be done better through the notmuch utility.
* db/manager: get rid of an unnecessary indentation levelAnton Khirnov2020-05-07
|
* db/utils: move is_subdir_of() to the single place it is used inAnton Khirnov2020-03-05
|
* db/manager: drop unused functionsAnton Khirnov2020-02-06
|
* Drop support for removing messages.Anton Khirnov2020-02-05
| | | | | This functionality is too obscure and dangerous, it should be done manually instead.
* Revert "db/manager: Drop async method"Anton Khirnov2020-01-02
| | | | This reverts commit e7e0c52db9093a9ecd9dcaa0766e66515a546a75.
* unused importPatrick Totzke2019-08-16
|
* db/manager: Drop async methodDylan Baker2019-08-15
| | | | | | | | | | As far as I can tell using a separate process doesn't actually improve performance, it makes it worse. The work that we're passing off to the separate function isn't necessarily work that's well suited to being handed off, there isn't a lot of computation and the objects that need to be passed across the pipe are fairly large (at least when considering a pipe). Converting the function to a generator gives better performance and simplifies the implementation.
* remove unused importsPatrick Totzke2019-08-11
|
* 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/manager: Append underscore to method named asyncJohannes Löthberg2018-08-01
| | | | | | | "async" is a reserved keyword in Python 3.7, so cannot be used for method names. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
* db/manager: use threads instead of reactor.callInThreadDylan Baker2018-07-26
| | | | | This is the obvious thing to do, and it works, but it does introduce some latency into starting alot.
* add setter for (notmuch) configs to database managerPatrick Totzke2018-07-24
| | | | these can be used to define/remove new named query strings
* add getter for named queries to DB managerPatrick Totzke2018-07-24
|
* Remove old __future__ importsLucas Hoffmann2018-06-19
| | | | They are not needed for python >= 3.0.
* Extract a level of nested conditionals for tag command.Ben Finney2018-04-23
|
* fix tagging and untagging.Dylan Baker2018-03-01
|
* py3k: remove basestring and unicode.Dylan Baker2018-03-01
| | | | This probably isn't completely right, but it's a start.
* interpret exclude_tagsPatrick Totzke2017-10-01
| | | | | | | | | this adds exclude tags to every query object. Just as in notmuch (option search.exclude_tags), this will essentially render messages invisible if tagged with one of those tags, unless they explicitly appear in the query. See also man notmuch-config(1). closes #732
* Merge branch 'master' into fix/spellingPatrick Totzke2017-09-02
|\
| * pep8 fixesPatrick Totzke2017-09-01
| | | | | | | | | | This mostly shortens lines down to <=79 chars and fixes some other small things I found using the pep8 tool.
* | Fix some spelling mistakesLucas Hoffmann2017-09-02
|/
* 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
* Exclude search.exclude_tags from searchesJohannes Löthberg2017-06-08
| | | | | | Fixes #707 and #332. Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
* Use absolute_imports from __future__Lucas Hoffmann2017-01-18
|
* Replace unused arguments with _Dylan Baker2016-12-21
| | | | | | | | | | This patch replaces a large number (but not all) unused arguments with the standard ``_`` placeholder. This has the advantage of signaling that these values are unused. There are a number of places that I've chosen not to apply this, largely in methods that have publicly define signatures that they inherit (usually from urwid).
* Don't use dict.keys when not necessaryDylan Baker2016-12-21
| | | | | | | | | | | It's pretty easy to get caught up using dict.keys (or iterkeys) when one doesn't need to. This patch corrects two cases where it's not needed, the first is the case of inclusion. ``x in mydict.keys()`` is equivalent to ``x in mydict``, but without the need to generate a list and walk it. The second case is when calling set() on a dict, ``set(mydict)`` will create a set object of the dict's keys, without the need to create one in memory and is significantly faster than ``set(mydict.keys())`` or even ``set(mydict.iterkeys())``.
* 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.
* 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 deprecated methodPatrick Totzke2015-11-24
| | | | see also issue #794
* just formating (pep8 etc.)Patrick Totzke2014-08-02
|