diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2011-10-16 14:28:42 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2011-10-16 14:28:42 +0100 |
commit | 1093f98e780ae9d09f3a28647fa15622422f1b55 (patch) | |
tree | 72b107fc378c27dd68089e6a86892c3beec5290d /alot | |
parent | ff1df26827ca2c67f24a5ede1afb7a0a7ace0c23 (diff) |
decorated glabals:shellescape
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/globals.py | 14 | ||||
-rw-r--r-- | alot/commands/thread.py | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py index 28f028f1..34236d64 100644 --- a/alot/commands/globals.py +++ b/alot/commands/globals.py @@ -80,11 +80,15 @@ class RefreshCommand(Command): @registerCommand(MODE, 'shellescape', arguments=[ + (['--spawn'], {'action': 'store_true', 'help':'run in terminal window'}), + (['--thread'], {'action': 'store_true', 'help':'run in separate thread'}), + (['--refocus'], {'action': 'store_true', 'help':'refocus current buffer \ + after command has finished'}), (['cmd'], {'help':'command line to execute'})], help='calls external command') class ExternalCommand(Command): def __init__(self, cmd, path=None, spawn=False, refocus=True, - in_thread=False, on_success=None, **kwargs): + thread=False, on_success=None, **kwargs): """ :param cmd: the command to call :type cmd: str @@ -92,8 +96,8 @@ class ExternalCommand(Command): :type path: str :param spawn: run command in a new terminal :type spawn: boolean - :param in_thread: run asynchronously, don't block alot - :type in_thread: boolean + :param thread: run asynchronously, don't block alot + :type thread: boolean :param refocus: refocus calling buffer after cmd termination :type refocus: boolean :param on_success: code to execute after command successfully exited @@ -103,7 +107,7 @@ class ExternalCommand(Command): self.path = path self.spawn = spawn self.refocus = refocus - self.in_thread = in_thread + self.in_thread = thread self.on_success = on_success Command.__init__(self, **kwargs) @@ -165,7 +169,7 @@ class EditCommand(ExternalCommand): editor_cmd = settings.config.get('general', 'editor_cmd') ExternalCommand.__init__(self, editor_cmd, path=self.path, - spawn=self.spawn, in_thread=self.spawn, + spawn=self.spawn, thread=self.spawn, **kwargs) diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 9d963fa7..add2b055 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -394,7 +394,7 @@ class OpenAttachmentCommand(Command): os.remove(path) ui.apply_command(ExternalCommand(handler, path=path, on_success=afterwards, - in_thread=True)) + thread=True)) else: ui.notify('unknown mime type') |