From 68774a2c757ae2ef12ea532abb594d66097cc490 Mon Sep 17 00:00:00 2001 From: Joel Torstensson Date: Tue, 3 Mar 2015 18:48:27 +0100 Subject: [PATCH] Style fixes. --- qutebrowser/browser/downloads.py | 8 +++++--- qutebrowser/config/configdata.py | 4 ++-- qutebrowser/config/configtypes.py | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/qutebrowser/browser/downloads.py b/qutebrowser/browser/downloads.py index 6bca9974d..1ad307b7a 100644 --- a/qutebrowser/browser/downloads.py +++ b/qutebrowser/browser/downloads.py @@ -289,7 +289,7 @@ class DownloadItem(QObject): download_dir = config.get('storage', 'download-directory') if download_dir is None: download_dir = standarddir.get(QStandardPaths.DownloadLocation) - return download_dir + os.sep + return download_dir def _die(self, msg): """Abort the download and emit an error.""" @@ -375,11 +375,13 @@ class DownloadItem(QObject): """Get the suggestion of file path""" suggestion = config.get('completion', 'download-path-suggestion') if suggestion == 'path': - return self._download_dir() + return self._download_dir() + os.sep elif suggestion == 'filename': return self.basename - else: + elif suggestion == 'both': return os.path.join(self._download_dir(), self.basename) + else: + raise ValueError("Invalid suggestion value {}!".format(suggestion)) def delete(self): """Delete the downloaded file""" diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index d0902009a..e87e49476 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -306,8 +306,8 @@ DATA = collections.OrderedDict([ ('completion', sect.KeyValue( ('download-path-suggestion', - SettingValue(typ.DownloadPath(), 'path'), - "What to show in the suggestion for the download question."), + SettingValue(typ.DownloadPathSuggestion(), 'path'), + "What to display in the download filename input."), ('show', SettingValue(typ.Bool(), 'true'), diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index a2838af84..f72622369 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -1416,7 +1416,7 @@ class NewInstanceOpenTarget(BaseType): ('window', "Open in a new window.")) -class DownloadPath(BaseType): +class DownloadPathSuggestion(BaseType): """How to format the question when downloading."""