diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-01-20 11:38:34 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-01-20 11:39:27 +0100 |
commit | d47a85bca83352300399f04e76abecea4d53a934 (patch) | |
tree | 741f5ce3857102f19e4d44c33dc93981b906268d /alot/__main__.py | |
parent | 3b78137e97565f90a48aad92dc471c47e63747eb (diff) |
db: make write operations async
Diffstat (limited to 'alot/__main__.py')
-rw-r--r-- | alot/__main__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/alot/__main__.py b/alot/__main__.py index d09a84f6..37d74f3b 100644 --- a/alot/__main__.py +++ b/alot/__main__.py @@ -2,6 +2,7 @@ # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file import argparse +import asyncio import logging import os import sys @@ -119,10 +120,12 @@ def main(): if options.colour_mode: settings.set('colourmode', options.colour_mode) + loop = asyncio.get_event_loop() + # get ourselves a database manager indexpath = settings.get_notmuch_setting('database', 'path') indexpath = options.mailindex_path or indexpath - dbman = DBManager(path=indexpath, ro=options.read_only) + dbman = DBManager(loop, path=indexpath, ro=options.read_only) # determine what to do if command is None: @@ -134,7 +137,7 @@ def main(): cmdstring = ' '.join(options.command) # set up and start interface - UI(dbman, cmdstring) + UI(loop, dbman, cmdstring) # run the exit hook exit_hook = settings.get_hook('exit') |