Fix lint and tests
This commit is contained in:
parent
2dccde8f4b
commit
24148c649e
@ -241,7 +241,6 @@ class FileDownloadTarget(_DownloadTarget):
|
||||
"""
|
||||
|
||||
def __init__(self, filename, force_overwrite=False):
|
||||
# pylint: disable=super-init-not-called
|
||||
self.filename = filename
|
||||
self.force_overwrite = force_overwrite
|
||||
|
||||
@ -261,7 +260,6 @@ class FileObjDownloadTarget(_DownloadTarget):
|
||||
"""
|
||||
|
||||
def __init__(self, fileobj):
|
||||
# pylint: disable=super-init-not-called
|
||||
self.fileobj = fileobj
|
||||
|
||||
def suggested_filename(self):
|
||||
@ -288,7 +286,6 @@ class OpenFileDownloadTarget(_DownloadTarget):
|
||||
"""
|
||||
|
||||
def __init__(self, cmdline=None):
|
||||
# pylint: disable=super-init-not-called
|
||||
self.cmdline = cmdline
|
||||
|
||||
def suggested_filename(self):
|
||||
@ -776,8 +773,8 @@ class AbstractDownloadItem(QObject):
|
||||
return
|
||||
|
||||
if isinstance(target, OpenFileDownloadTarget):
|
||||
self.finished.connect(
|
||||
functools.partial(self._open_if_successful, target.cmdline))
|
||||
self.finished.connect(functools.partial(
|
||||
self._open_if_successful, target.cmdline))
|
||||
elif isinstance(target, PDFJSDownloadTarget):
|
||||
self.finished.connect(self._pdfjs_if_successful)
|
||||
else:
|
||||
|
@ -48,7 +48,6 @@ from qutebrowser.browser import pdfjs
|
||||
from qutebrowser.config import config, configdata, configexc, configdiff
|
||||
from qutebrowser.utils import (version, utils, jinja, log, message, docutils,
|
||||
objreg, urlutils)
|
||||
from qutebrowser.misc import objects
|
||||
from qutebrowser.qt import sip
|
||||
|
||||
|
||||
|
@ -225,7 +225,6 @@ class DownloadManager(downloads.AbstractDownloadManager):
|
||||
download.set_target(downloads.PDFJSDownloadTarget())
|
||||
return
|
||||
|
||||
|
||||
filename = downloads.immediate_download_path()
|
||||
if filename is not None:
|
||||
# User doesn't want to be asked, so just use the download_dir
|
||||
|
@ -19,14 +19,12 @@
|
||||
|
||||
"""QtWebKit specific qute://* handlers and glue code."""
|
||||
|
||||
import mimetypes
|
||||
|
||||
from PyQt5.QtCore import QUrl
|
||||
from PyQt5.QtNetwork import QNetworkReply, QNetworkAccessManager
|
||||
|
||||
from qutebrowser.browser import qutescheme
|
||||
from qutebrowser.browser.webkit.network import networkreply
|
||||
from qutebrowser.utils import log, usertypes, qtutils
|
||||
from qutebrowser.utils import log, qtutils
|
||||
|
||||
|
||||
def handler(request, operation, current_url):
|
||||
|
@ -17,8 +17,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
from PyQt5.QtCore import QUrl
|
||||
|
||||
|
@ -68,10 +68,6 @@ def test_page_titles(url, title, out):
|
||||
|
||||
class TestDownloadTarget:
|
||||
|
||||
def test_base(self):
|
||||
with pytest.raises(NotImplementedError):
|
||||
downloads._DownloadTarget()
|
||||
|
||||
def test_filename(self):
|
||||
target = downloads.FileDownloadTarget("/foo/bar")
|
||||
assert target.filename == "/foo/bar"
|
||||
|
Loading…
Reference in New Issue
Block a user