summaryrefslogtreecommitdiff
path: root/qutebrowser
diff options
context:
space:
mode:
authorlufte <javier@lufte.net>2021-07-03 21:11:09 -0300
committerlufte <javier@lufte.net>2021-07-03 21:11:09 -0300
commit9aa6a76471d2669cfd61a164ba0111b1bb31fca6 (patch)
treec50617166aee5551f6285f3c72324c66def5c7fe /qutebrowser
parent484ac43cf1b090953ff4efde617f0a2fc07177cd (diff)
downloadqutebrowser-9aa6a76471d2669cfd61a164ba0111b1bb31fca6.tar.gz
qutebrowser-9aa6a76471d2669cfd61a164ba0111b1bb31fca6.zip
Cosmetic changes
Diffstat (limited to 'qutebrowser')
-rw-r--r--qutebrowser/browser/history.py13
-rw-r--r--qutebrowser/misc/sql.py2
2 files changed, 8 insertions, 7 deletions
diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py
index 4163f1957..559992327 100644
--- a/qutebrowser/browser/history.py
+++ b/qutebrowser/browser/history.py
@@ -23,7 +23,7 @@ import os
import time
import contextlib
import pathlib
-from typing import cast, Mapping, MutableSequence
+from typing import cast, Mapping, MutableSequence, Optional
from PyQt5.QtCore import pyqtSlot, QUrl, QObject, pyqtSignal
from PyQt5.QtWidgets import QProgressDialog, QApplication
@@ -92,7 +92,8 @@ class CompletionMetaInfo(sql.SqlTable):
'force_rebuild': False,
}
- def __init__(self, database: sql.Database, parent: QObject = None):
+ def __init__(self, database: sql.Database,
+ parent: Optional[QObject] = None) -> None:
self._fields = ['key', 'value']
self._constraints = {'key': 'PRIMARY KEY'}
super().__init__(database, "CompletionMetaInfo", self._fields,
@@ -139,7 +140,8 @@ class CompletionHistory(sql.SqlTable):
"""History which only has the newest entry for each URL."""
- def __init__(self, database: sql.Database, parent: QObject = None):
+ def __init__(self, database: sql.Database,
+ parent: Optional[QObject] = None) -> None:
super().__init__(database, "CompletionHistory", ['url', 'title', 'last_atime'],
constraints={'url': 'PRIMARY KEY',
'title': 'NOT NULL',
@@ -155,7 +157,6 @@ class WebHistory(sql.SqlTable):
Attributes:
completion: A CompletionHistory instance.
metainfo: A CompletionMetaInfo instance.
- database: The Database instance where history is persisted.
_progress: A HistoryProgress instance.
"""
@@ -165,7 +166,7 @@ class WebHistory(sql.SqlTable):
url_cleared = pyqtSignal(QUrl)
def __init__(self, database: sql.Database, progress: HistoryProgress,
- parent: QObject = None):
+ parent: Optional[QObject] = None) -> None:
super().__init__(database, "History", ['url', 'title', 'atime', 'redirect'],
constraints={'url': 'NOT NULL',
'title': 'NOT NULL',
@@ -477,7 +478,7 @@ def debug_dump_history(dest):
raise cmdutils.CommandError(f'Could not write history: {e}')
-def init(db_path: pathlib.Path, parent: QObject = None) -> None:
+def init(db_path: pathlib.Path, parent: Optional[QObject] = None) -> None:
"""Initialize the web history.
Args:
diff --git a/qutebrowser/misc/sql.py b/qutebrowser/misc/sql.py
index 460d88ce9..814eb2bb0 100644
--- a/qutebrowser/misc/sql.py
+++ b/qutebrowser/misc/sql.py
@@ -402,7 +402,7 @@ class SqlTable(QObject):
"""Wrapper over a table in the SQL database.
Args:
- database: The Database object on which to operate.
+ database: The Database to which this table belongs.
name: Name of the table.
fields: A list of field names.
constraints: A dict mapping field names to constraint strings.