summaryrefslogtreecommitdiff
path: root/alot/commands/common.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-07-18 09:56:53 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-07-26 10:36:16 -0700
commit781d0a824d5c08277ac73093a4846bd4f6dd2ff6 (patch)
tree1f419f7c517a42421d6ed400e4e59e7001f5dcc2 /alot/commands/common.py
parent0c8d2b2f30aaa1f6dbc7117464836c76597909ed (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/commands/common.py')
-rw-r--r--alot/commands/common.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/alot/commands/common.py b/alot/commands/common.py
index 71280d38..8280a5c0 100644
--- a/alot/commands/common.py
+++ b/alot/commands/common.py
@@ -1,4 +1,5 @@
# Copyright (C) 2011-2012 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
@@ -10,7 +11,7 @@ from .globals import PromptCommand
class RetagPromptCommand(Command):
"""prompt to retag selected thread's or message's tags"""
- def apply(self, ui):
+ async def apply(self, ui):
get_selected_item = getattr(ui.current_buffer, {
'search': 'get_selected_thread',
'thread': 'get_selected_message'}[ui.mode])
@@ -25,4 +26,5 @@ class RetagPromptCommand(Command):
elif tag:
tags.append(tag)
initial_tagstring = ','.join(sorted(tags)) + ','
- return ui.apply_command(PromptCommand('retag ' + initial_tagstring))
+ r = await ui.apply_command(PromptCommand('retag ' + initial_tagstring))
+ return r