open-download: append filename if no {} is found

This allows shortcuts like ":download-open gvim" instead of
":download-open gvim {}" to work.
This commit is contained in:
Daniel Schadt 2016-08-04 11:50:35 +02:00
parent 8730dc6f8e
commit 017bfc9b9c

View File

@ -554,6 +554,8 @@ class DownloadItem(QObject):
cmd, *args = shlex.split(cmdline) cmd, *args = shlex.split(cmdline)
args = [arg.replace('{}', filename) for arg in args] args = [arg.replace('{}', filename) for arg in args]
if '{}' not in cmdline:
args.append(filename)
log.downloads.debug("Opening {} with {}" log.downloads.debug("Opening {} with {}"
.format(filename, [cmd] + args)) .format(filename, [cmd] + args))
proc = guiprocess.GUIProcess(self._win_id, what='download') proc = guiprocess.GUIProcess(self._win_id, what='download')