Small sql fixes.
- Remove unused SqlTable.Entry - Fix wording of two log messages - Remove unused import
This commit is contained in:
parent
f4f52ee204
commit
e436f48164
@ -25,7 +25,7 @@ import time
|
||||
from PyQt5.QtCore import pyqtSlot, QUrl, QTimer
|
||||
|
||||
from qutebrowser.commands import cmdutils, cmdexc
|
||||
from qutebrowser.utils import (utils, objreg, log, qtutils, usertypes, message,
|
||||
from qutebrowser.utils import (utils, objreg, log, usertypes, message,
|
||||
debug, standarddir)
|
||||
from qutebrowser.misc import objects, sql
|
||||
|
||||
@ -257,7 +257,7 @@ class WebHistory(sql.SqlTable):
|
||||
f.write('\n'.join(lines))
|
||||
except OSError as e:
|
||||
raise cmdexc.CommandError('Could not write history: {}', e)
|
||||
message.info("Dumped history to {}.".format(dest))
|
||||
message.info("Dumped history to {}".format(dest))
|
||||
|
||||
|
||||
def init(parent=None):
|
||||
|
@ -89,7 +89,7 @@ class Query(QSqlQuery):
|
||||
log.sql.debug('Running SQL query: "{}"'.format(self.lastQuery()))
|
||||
for key, val in values.items():
|
||||
self.bindValue(':{}'.format(key), val)
|
||||
log.sql.debug('self bindings: {}'.format(self.boundValues()))
|
||||
log.sql.debug('query bindings: {}'.format(self.boundValues()))
|
||||
if not self.exec_():
|
||||
raise SqlException('Failed to exec query "{}": "{}"'.format(
|
||||
self.lastQuery(), self.lastError().text()))
|
||||
@ -107,7 +107,6 @@ class SqlTable(QObject):
|
||||
"""Interface to a sql table.
|
||||
|
||||
Attributes:
|
||||
Entry: The class wrapping row data from this table.
|
||||
_name: Name of the SQL table this wraps.
|
||||
|
||||
Signals:
|
||||
@ -136,8 +135,6 @@ class SqlTable(QObject):
|
||||
.format(name, ','.join(column_defs)))
|
||||
|
||||
q.run()
|
||||
# pylint: disable=invalid-name
|
||||
self.Entry = collections.namedtuple(name + '_Entry', fields)
|
||||
|
||||
def create_index(self, name, field):
|
||||
"""Create an index over this table.
|
||||
|
Loading…
Reference in New Issue
Block a user