summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-09-24 11:52:04 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-09-24 11:52:04 +0100
commit9ab36789aab5446444ccfc9c54579c0700babf4e (patch)
treeec868ffe0dc2c9bd4fdf80befa2387132e5fe3ad /alot
parentdb6e7c2842f41d5f5efaf2392e83a9f7bee95021 (diff)
use external command templates in OnenAttachment
Diffstat (limited to 'alot')
-rw-r--r--alot/command.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/alot/command.py b/alot/command.py
index e491d583..62952d18 100644
--- a/alot/command.py
+++ b/alot/command.py
@@ -842,14 +842,12 @@ class OpenAttachmentCommand(Command):
handler = settings.get_mime_handler(mimetype)
if handler:
path = self.attachment.save(tempfile.gettempdir())
- if '%s' in handler:
- cmd = handler % path
- else:
- cmd = '%s %s' % (handler, path)
+ handler = handler.replace('%s', '{}')
def afterwards():
os.remove(path)
- ui.apply_command(ExternalCommand(cmd, on_success=afterwards,
+ ui.apply_command(ExternalCommand(handler, path=path,
+ on_success=afterwards,
in_thread=True))
else:
ui.notify('unknown mime type')