diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-07-18 09:56:53 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-07-26 10:36:16 -0700 |
commit | 781d0a824d5c08277ac73093a4846bd4f6dd2ff6 (patch) | |
tree | 1f419f7c517a42421d6ed400e4e59e7001f5dcc2 /alot/buffers/thread.py | |
parent | 0c8d2b2f30aaa1f6dbc7117464836c76597909ed (diff) |
ui: Convert apply_command to a coroutine
This is a pretty invasive patch, since the ui code is used so
extensively, it requires going into a lot of other code and converting
those to coroutines, since before they returned deferred's.
Diffstat (limited to 'alot/buffers/thread.py')
-rw-r--r-- | alot/buffers/thread.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/alot/buffers/thread.py b/alot/buffers/thread.py index c89d4688..15aa9354 100644 --- a/alot/buffers/thread.py +++ b/alot/buffers/thread.py @@ -1,6 +1,8 @@ # Copyright (C) 2011-2018 Patrick Totzke <patricktotzke@gmail.com> +# Copyright © 2018 Dylan Baker # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file +import asyncio import urwid import logging from urwidtrees import ArrowTree, TreeBox, NestedTree @@ -112,7 +114,8 @@ class ThreadBuffer(Buffer): self._auto_unread_writing = True msg.remove_tags(['unread'], afterwards=clear) fcmd = commands.globals.FlushCommand(silent=True) - self.ui.apply_command(fcmd) + asyncio.get_event_loop().create_task( + self.ui.apply_command(fcmd)) else: logging.debug('Tbuffer: No, msg not unread') else: |