Fix pylint/flake8 for sql work.
This commit is contained in:
parent
8ff45331df
commit
3e63b62d6e
@ -479,8 +479,8 @@ def _init_modules(args, crash_handler):
|
||||
def _import_history():
|
||||
"""Import a history text file into sqlite if it exists.
|
||||
|
||||
In older versions of qutebrowser, history was stored in a text format.
|
||||
This converts that file into the new sqlite format and removes it.
|
||||
In older versions of qutebrowser, history was stored in a text format.
|
||||
This converts that file into the new sqlite format and removes it.
|
||||
"""
|
||||
path = os.path.join(standarddir.data(), 'history')
|
||||
if not os.path.isfile(path):
|
||||
|
@ -20,13 +20,11 @@
|
||||
"""Simple history which gets written to disk."""
|
||||
|
||||
import time
|
||||
import os
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl
|
||||
|
||||
from qutebrowser.commands import cmdutils
|
||||
from qutebrowser.utils import (utils, objreg, standarddir, log, qtutils,
|
||||
usertypes, message)
|
||||
from qutebrowser.utils import utils, objreg, log, qtutils, usertypes, message
|
||||
from qutebrowser.misc import objects, sql
|
||||
|
||||
|
||||
@ -201,7 +199,7 @@ class WebHistory(sql.SqlTable):
|
||||
|
||||
def read(self, path):
|
||||
"""Import a text file into the sql database."""
|
||||
with open(path, 'r') as f:
|
||||
with open(path, 'r', encoding='utf-8') as f:
|
||||
rows = []
|
||||
for line in f:
|
||||
try:
|
||||
|
@ -21,7 +21,7 @@ import os.path
|
||||
|
||||
import pytest_bdd as bdd
|
||||
|
||||
from PyQt5.QtSql import QSqlDatabase, QSqlQuery
|
||||
from PyQt5.QtSql import QSqlDatabase
|
||||
|
||||
bdd.scenarios('history.feature')
|
||||
|
||||
|
@ -22,8 +22,6 @@
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
import hypothesis
|
||||
from hypothesis import strategies
|
||||
from PyQt5.QtCore import QUrl
|
||||
|
||||
from qutebrowser.browser import history
|
||||
@ -69,7 +67,7 @@ def test_get_recent(hist):
|
||||
hist.add_url(QUrl('http://www.qutebrowser.org/'), atime=67890)
|
||||
hist.add_url(QUrl('http://example.com/'), atime=12345)
|
||||
assert list(hist.get_recent()) == [
|
||||
('http://www.qutebrowser.org/', '', 67890 , False),
|
||||
('http://www.qutebrowser.org/', '', 67890, False),
|
||||
('http://example.com/', '', 12345, False),
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user