diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-02-08 17:13:49 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-02-08 17:13:49 +0000 |
commit | 3fb360e231efcfe42eab4127bac5f6bafa1403a6 (patch) | |
tree | 390ce87e63babf840763006b436ffb4d83e8968b | |
parent | 35ae1d8b9fd3a455f7050ae592b6b044cf353f61 (diff) |
'spawn' parameter for Compose and EditCommands
that overides the global config option spawn
issue #287
-rw-r--r-- | alot/commands/globals.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 1b444ea2..2c39f3dc 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -444,12 +444,14 @@ class HelpCommand(Command): (['--attach'], {'nargs':'+', 'help':'attach files'}), (['--omit_signature'], {'action': 'store_true', 'help':'do not add signature'}), + (['--spawn'], {'action': 'store_true', + 'help':'spawn editor in new terminal'}), ]) class ComposeCommand(Command): """compose a new email""" def __init__(self, envelope=None, headers={}, template=None, sender=u'', subject=u'', to=[], cc=[], bcc=[], attach=None, - omit_signature=False, **kwargs): + omit_signature=False, spawn=None, **kwargs): """ :param envelope: use existing envelope :type envelope: :class:`~alot.message.Envelope` @@ -473,6 +475,8 @@ class ComposeCommand(Command): :type attach: str :param omit_signature: do not attach/append signature :type omit_signature: bool + :param spawn: force spawning of editor in a new terminal + :type spawn: bool """ Command.__init__(self, **kwargs) @@ -487,6 +491,7 @@ class ComposeCommand(Command): self.bcc = bcc self.attach = attach self.omit_signature = omit_signature + self.force_spawn = spawn @inlineCallbacks def apply(self, ui): @@ -623,7 +628,8 @@ class ComposeCommand(Command): self.envelope.attach(a) logging.debug('attaching: ' + a) - cmd = commands.envelope.EditCommand(envelope=self.envelope) + cmd = commands.envelope.EditCommand(envelope=self.envelope, + spawn=self.force_spawn) ui.apply_command(cmd) |