From d21b42662d2c0864e7e84172bd76e5221c4ef8c8 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 4 Aug 2016 11:54:27 +0200 Subject: [PATCH] Minor Text Fixes default (program) -> default application surround {} with backticks mention that the filename will be appended in the docstrings --- qutebrowser/browser/webkit/downloads.py | 13 ++++++++----- qutebrowser/mainwindow/statusbar/prompter.py | 4 +++- qutebrowser/utils/usertypes.py | 5 +++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/qutebrowser/browser/webkit/downloads.py b/qutebrowser/browser/webkit/downloads.py index 422984934..265d6ce33 100644 --- a/qutebrowser/browser/webkit/downloads.py +++ b/qutebrowser/browser/webkit/downloads.py @@ -534,8 +534,10 @@ class DownloadItem(QObject): """Open the downloaded file. Args: - cmdline: The command to use, or None for the system's default - program. + cmdline: The command to use as string. A `{}` is expanded to the + filename. None means to use the system's default + application. If no `{}` is found, the filename is appended + to the cmdline. """ assert self.successful filename = self._filename @@ -988,8 +990,7 @@ class DownloadManager(QAbstractListModel): Args: download: The DownloadItem to use. - cmdline: The command to use, or None for the system's default - program. + cmdline: Passed to DownloadItem.open_file(). """ if not download.successful: log.downloads.debug("{} finished but not successful, not opening!" @@ -1064,7 +1065,9 @@ class DownloadManager(QAbstractListModel): Args: cmdline: The command which should be used to open the file. A `{}` - is expanded to the temporary file name. + is expanded to the temporary file name. If no `{}` is + present, the filename is automatically appended to the + cmdline. count: The index of the download to open. """ try: diff --git a/qutebrowser/mainwindow/statusbar/prompter.py b/qutebrowser/mainwindow/statusbar/prompter.py index cbcb965af..337b71e1d 100644 --- a/qutebrowser/mainwindow/statusbar/prompter.py +++ b/qutebrowser/mainwindow/statusbar/prompter.py @@ -321,7 +321,9 @@ class Prompter(QObject): Args: cmdline: The command which should be used to open the file. A `{}` - is expanded to the temporary file name. + is expanded to the temporary file name. If no `{}` is + present, the filename is automatically appended to the + cmdline. """ if self._question.mode != usertypes.PromptMode.download: # We just ignore this if we don't have a download question. diff --git a/qutebrowser/utils/usertypes.py b/qutebrowser/utils/usertypes.py index bd4930094..65c3c31e2 100644 --- a/qutebrowser/utils/usertypes.py +++ b/qutebrowser/utils/usertypes.py @@ -300,8 +300,9 @@ class OpenFileDownloadTarget(DownloadTarget): """Save the download in a temp dir and directly open it. Attributes: - cmdline: The command to use as string. A {} is expanded to the - filename. None means use the system's default. + cmdline: The command to use as string. A `{}` is expanded to the + filename. None means to use the system's default application. + If no `{}` is found, the filename is appended to the cmdline. """ def __init__(self, cmdline=None):