summaryrefslogtreecommitdiff
path: root/alot/commands/search.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/search.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/search.py')
-rw-r--r--alot/commands/search.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/alot/commands/search.py b/alot/commands/search.py
index 2b8e4849..c6c5cab6 100644
--- a/alot/commands/search.py
+++ b/alot/commands/search.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
import argparse
@@ -87,10 +88,10 @@ class RefinePromptCommand(Command):
"""prompt to change this buffers querystring"""
repeatable = True
- def apply(self, ui):
+ async def apply(self, ui):
sbuffer = ui.current_buffer
oldquery = sbuffer.querystring
- return ui.apply_command(PromptCommand('refine ' + oldquery))
+ return await ui.apply_command(PromptCommand('refine ' + oldquery))
RetagPromptCommand = registerCommand(MODE, 'retagprompt')(RetagPromptCommand)
@@ -164,7 +165,7 @@ class TagCommand(Command):
self.flush = flush
Command.__init__(self, **kwargs)
- def apply(self, ui):
+ async def apply(self, ui):
searchbuffer = ui.current_buffer
threadline_widget = searchbuffer.get_selected_threadline()
# pass if the current buffer has no selected threadline
@@ -226,7 +227,8 @@ class TagCommand(Command):
# flush index
if self.flush:
- ui.apply_command(commands.globals.FlushCommand(callback=refresh))
+ await ui.apply_command(
+ commands.globals.FlushCommand(callback=refresh))
@registerCommand(