summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/commands/globals.py13
-rw-r--r--alot/ui.py1
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)
diff --git a/alot/ui.py b/alot/ui.py
index cb9f16d2..81d61556 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -523,3 +523,4 @@ class UI(object):
d = defer.maybeDeferred(cmd.apply, self)
d.addErrback(errorHandler)
d.addCallback(call_posthook)
+ return d