From 222ebaed846ba6739e17a09c2b16f10c853790bf Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 3 Dec 2021 22:29:32 +0100 Subject: ui: change command hooks back to normal callables They are treated as coroutines now, but this does not seem to be documented. This is a step towards making commands synhronous again. --- alot/ui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alot/ui.py b/alot/ui.py index 69c9cda3..b975a511 100644 --- a/alot/ui.py +++ b/alot/ui.py @@ -719,7 +719,7 @@ class UI: # allowed as a value fo cmd. if cmd: if cmd.prehook: - await cmd.prehook(ui=self, dbm=self.dbman, cmd=cmd) + cmd.prehook(ui=self, dbm=self.dbman, cmd=cmd) try: if asyncio.iscoroutinefunction(cmd.apply): await cmd.apply(self) @@ -730,7 +730,7 @@ class UI: else: if cmd.posthook: logging.info('calling post-hook') - await cmd.posthook(ui=self, dbm=self.dbman, cmd=cmd) + cmd.posthook(ui=self, dbm=self.dbman, cmd=cmd) def handle_signal(self, signum, frame): """ -- cgit v1.2.3