diff options
-rw-r--r-- | alot/commands/globals.py | 13 | ||||
-rw-r--r-- | alot/ui.py | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 587cfa48..0f417851 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -749,3 +749,16 @@ class ComposeCommand(Command): spawn=self.force_spawn, refocus=False) ui.apply_command(cmd) + + +class CommandSequenceCommand(Command): + """Meta-Command that just applies a sequence of given Commands in order""" + + def __init__(self, commandlist=[]): + self.commandlist = commandlist + + @inlineCallbacks + def apply(self, ui): + for cmd in self.commandlist: + logging.debug('CMDSEQ: apply %s' % str(cmd)) + yield ui.apply(cmd) @@ -523,3 +523,4 @@ class UI(object): d = defer.maybeDeferred(cmd.apply, self) d.addErrback(errorHandler) d.addCallback(call_posthook) + return d |