Implementation¶
Database Manager¶
The design of the database manager was inspired by alots database
manager alot.db.DBManager
.
-
class
afew.Database.
Database
[source]¶ Convenience wrapper around notmuch.
-
add_message
(path, sync_maildir_flags=False, new_mail_handler=None)[source]¶ Adds the given message to the notmuch index.
- Parameters
- Raises
notmuch.NotmuchError
if adding the message fails- Returns
a
notmuch.Message
object
-
do_query
(query)[source]¶ Executes a notmuch query.
- Parameters
query (str) – the query to execute
- Returns
the query result
- Return type
notmuch.Query
-
get_messages
(query, full_thread=False)[source]¶ Get all messages mathing the given query.
- Parameters
query (str) – the query to execute using
Database.do_query()
full_thread (bool) – return all messages from mathing threads
- Returns
an iterator over
notmuch.Message
objects
-
remove_message
(path)[source]¶ Remove the given message from the notmuch index.
- Parameters
path (str) – path to the message
-