Merge pull request #8269 from qutebrowser/update-dependencies
Update dependencies
This commit is contained in:
commit
afe3e4aef5
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
build==1.2.1
|
||||
check-manifest==0.49
|
||||
importlib_metadata==8.0.0
|
||||
importlib_metadata==8.2.0
|
||||
packaging==24.1
|
||||
pyproject_hooks==1.1.0
|
||||
tomli==2.0.1
|
||||
zipp==3.19.2
|
||||
zipp==3.20.0
|
||||
|
|
|
|||
|
|
@ -1,33 +1,38 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
autocommand==2.2.2
|
||||
backports.tarfile==1.2.0
|
||||
build==1.2.1
|
||||
bump2version==1.0.1
|
||||
certifi==2024.7.4
|
||||
cffi==1.16.0
|
||||
cffi==1.17.0
|
||||
charset-normalizer==3.3.2
|
||||
cryptography==42.0.8
|
||||
cryptography==43.0.0
|
||||
docutils==0.20.1
|
||||
github3.py==4.0.1
|
||||
hunter==3.7.0
|
||||
idna==3.7
|
||||
importlib_metadata==8.0.0
|
||||
importlib_metadata==8.2.0
|
||||
importlib_resources==6.4.0
|
||||
inflect==7.3.1
|
||||
jaraco.classes==3.4.0
|
||||
jaraco.context==5.3.0
|
||||
jaraco.functools==4.0.1
|
||||
jaraco.functools==4.0.2
|
||||
jaraco.text==3.12.1
|
||||
jeepney==0.8.0
|
||||
keyring==25.2.1
|
||||
keyring==25.3.0
|
||||
manhole==1.8.1
|
||||
markdown-it-py==3.0.0
|
||||
mdurl==0.1.2
|
||||
more-itertools==10.3.0
|
||||
more-itertools==10.4.0
|
||||
nh3==0.2.18
|
||||
ordered-set==4.1.0
|
||||
packaging==24.1
|
||||
pkginfo==1.10.0
|
||||
platformdirs==4.2.2
|
||||
pycparser==2.22
|
||||
Pygments==2.18.0
|
||||
PyJWT==2.8.0
|
||||
PyJWT==2.9.0
|
||||
Pympler==1.1
|
||||
pyproject_hooks==1.1.0
|
||||
PyQt-builder==1.16.4
|
||||
|
|
@ -42,7 +47,8 @@ sip==6.8.6
|
|||
six==1.16.0
|
||||
tomli==2.0.1
|
||||
twine==5.1.1
|
||||
typeguard==4.3.0
|
||||
typing_extensions==4.12.2
|
||||
uritemplate==4.1.1
|
||||
# urllib3==2.2.2
|
||||
zipp==3.19.2
|
||||
zipp==3.20.0
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
asciidoc==10.2.0
|
||||
asciidoc==10.2.1
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
attrs==23.2.0
|
||||
flake8==7.1.0
|
||||
attrs==24.2.0
|
||||
flake8==7.1.1
|
||||
flake8-bugbear==24.4.26
|
||||
flake8-builtins==2.5.0
|
||||
flake8-comprehensions==3.15.0
|
||||
|
|
@ -16,7 +16,7 @@ flake8-tidy-imports==4.10.0
|
|||
flake8-tuple==0.4.1
|
||||
mccabe==0.7.0
|
||||
pep8-naming==0.14.1
|
||||
pycodestyle==2.12.0
|
||||
pycodestyle==2.12.1
|
||||
pydocstyle==6.3.0
|
||||
pyflakes==3.2.0
|
||||
six==1.16.0
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
chardet==5.2.0
|
||||
diff_cover==9.1.0
|
||||
diff_cover==9.1.1
|
||||
importlib_resources==6.4.0
|
||||
Jinja2==3.1.4
|
||||
lxml==5.2.2
|
||||
lxml==5.3.0
|
||||
MarkupSafe==2.1.5
|
||||
mypy==1.10.1
|
||||
mypy==1.11.1
|
||||
mypy-extensions==1.0.0
|
||||
pluggy==1.5.0
|
||||
Pygments==2.18.0
|
||||
PyQt5-stubs==5.15.6.0
|
||||
tomli==2.0.1
|
||||
types-colorama==0.4.15.20240311
|
||||
types-docutils==0.21.0.20240711
|
||||
types-docutils==0.21.0.20240724
|
||||
types-Pygments==2.18.0.20240506
|
||||
types-PyYAML==6.0.12.20240311
|
||||
types-setuptools==70.3.0.20240710
|
||||
types-PyYAML==6.0.12.20240808
|
||||
types-setuptools==71.1.0.20240806
|
||||
typing_extensions==4.12.2
|
||||
zipp==3.19.2
|
||||
zipp==3.20.0
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
altgraph==0.17.4
|
||||
importlib_metadata==8.0.0
|
||||
importlib_metadata==8.2.0
|
||||
packaging==24.1
|
||||
pyinstaller==6.9.0
|
||||
pyinstaller-hooks-contrib==2024.7
|
||||
zipp==3.19.2
|
||||
pyinstaller==6.10.0
|
||||
pyinstaller-hooks-contrib==2024.8
|
||||
zipp==3.20.0
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
astroid==3.2.3
|
||||
astroid==3.2.4
|
||||
certifi==2024.7.4
|
||||
cffi==1.16.0
|
||||
cffi==1.17.0
|
||||
charset-normalizer==3.3.2
|
||||
cryptography==42.0.8
|
||||
cryptography==43.0.0
|
||||
dill==0.3.8
|
||||
github3.py==4.0.1
|
||||
idna==3.7
|
||||
|
|
@ -13,8 +13,8 @@ mccabe==0.7.0
|
|||
pefile==2023.2.7
|
||||
platformdirs==4.2.2
|
||||
pycparser==2.22
|
||||
PyJWT==2.8.0
|
||||
pylint==3.2.5
|
||||
PyJWT==2.9.0
|
||||
pylint==3.2.6
|
||||
python-dateutil==2.9.0.post0
|
||||
./scripts/dev/pylint_checkers
|
||||
requests==2.32.3
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
PyQt5==5.15.10 # rq.filter: < 5.16
|
||||
PyQt5==5.15.11 # rq.filter: < 5.16
|
||||
PyQt5-Qt5==5.15.14
|
||||
PyQt5_sip==12.15.0
|
||||
PyQtWebEngine==5.15.6 # rq.filter: < 5.16
|
||||
PyQtWebEngine==5.15.7 # rq.filter: < 5.16
|
||||
PyQtWebEngine-Qt5==5.15.14
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
PyQt5==5.15.10
|
||||
PyQt5==5.15.11
|
||||
PyQt5-Qt5==5.15.14
|
||||
PyQt5_sip==12.15.0
|
||||
PyQtWebEngine==5.15.6
|
||||
PyQtWebEngine==5.15.7
|
||||
PyQtWebEngine-Qt5==5.15.14
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
PyQt6==6.7.0
|
||||
PyQt6==6.7.1
|
||||
PyQt6-Qt6==6.7.2
|
||||
PyQt6-WebEngine==6.7.0
|
||||
PyQt6-WebEngine-Qt6==6.7.2
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
PyQt6==6.7.0
|
||||
PyQt6==6.7.1
|
||||
PyQt6-Qt6==6.7.2
|
||||
PyQt6-WebEngine==6.7.0
|
||||
PyQt6-WebEngine-Qt6==6.7.2
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
PyQt6==6.7.0
|
||||
PyQt6==6.7.1
|
||||
PyQt6-Qt6==6.7.2
|
||||
PyQt6-WebEngine==6.7.0
|
||||
PyQt6-WebEngine-Qt6==6.7.2
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ certifi==2024.7.4
|
|||
charset-normalizer==3.3.2
|
||||
docutils==0.20.1
|
||||
idna==3.7
|
||||
importlib_metadata==8.0.0
|
||||
importlib_metadata==8.2.0
|
||||
packaging==24.1
|
||||
Pygments==2.18.0
|
||||
pyproject_hooks==1.1.0
|
||||
|
|
@ -14,4 +14,4 @@ requests==2.32.3
|
|||
tomli==2.0.1
|
||||
trove-classifiers==2024.7.2
|
||||
urllib3==2.2.2
|
||||
zipp==3.19.2
|
||||
zipp==3.20.0
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
alabaster==0.7.13
|
||||
Babel==2.15.0
|
||||
babel==2.16.0
|
||||
certifi==2024.7.4
|
||||
charset-normalizer==3.3.2
|
||||
docutils==0.20.1
|
||||
idna==3.7
|
||||
imagesize==1.4.1
|
||||
importlib_metadata==8.0.0
|
||||
importlib_metadata==8.2.0
|
||||
Jinja2==3.1.4
|
||||
MarkupSafe==2.1.5
|
||||
packaging==24.1
|
||||
|
|
@ -23,4 +23,4 @@ sphinxcontrib-jsmath==1.0.1
|
|||
sphinxcontrib-qthelp==1.0.3
|
||||
sphinxcontrib-serializinghtml==1.1.5
|
||||
urllib3==2.2.2
|
||||
zipp==3.19.2
|
||||
zipp==3.20.0
|
||||
|
|
|
|||
|
|
@ -1,36 +1,44 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
attrs==23.2.0
|
||||
attrs==24.2.0
|
||||
autocommand==2.2.2
|
||||
backports.tarfile==1.2.0
|
||||
beautifulsoup4==4.12.3
|
||||
blinker==1.8.2
|
||||
certifi==2024.7.4
|
||||
charset-normalizer==3.3.2
|
||||
cheroot==10.0.1
|
||||
click==8.1.7
|
||||
coverage==7.6.0
|
||||
coverage==7.6.1
|
||||
exceptiongroup==1.2.2
|
||||
execnet==2.1.1
|
||||
filelock==3.15.4
|
||||
Flask==3.0.3
|
||||
hunter==3.7.0
|
||||
hypothesis==6.108.2
|
||||
hypothesis==6.111.0
|
||||
idna==3.7
|
||||
importlib_metadata==8.0.0
|
||||
importlib_metadata==8.2.0
|
||||
importlib_resources==6.4.0
|
||||
inflect==7.3.1
|
||||
iniconfig==2.0.0
|
||||
itsdangerous==2.2.0
|
||||
jaraco.functools==4.0.1
|
||||
jaraco.context==5.3.0
|
||||
jaraco.functools==4.0.2
|
||||
jaraco.text==3.12.1
|
||||
# Jinja2==3.1.4
|
||||
Mako==1.3.5
|
||||
manhole==1.8.1
|
||||
# MarkupSafe==2.1.5
|
||||
more-itertools==10.3.0
|
||||
more-itertools==10.4.0
|
||||
ordered-set==4.1.0
|
||||
packaging==24.1
|
||||
parse==1.20.2
|
||||
parse-type==0.6.2
|
||||
platformdirs==4.2.2
|
||||
pluggy==1.5.0
|
||||
py-cpuinfo==9.0.0
|
||||
Pygments==2.18.0
|
||||
pytest==8.2.2
|
||||
pytest==8.3.2
|
||||
pytest-bdd==7.2.0
|
||||
pytest-benchmark==4.0.0
|
||||
pytest-cov==5.0.0
|
||||
|
|
@ -49,8 +57,9 @@ sortedcontainers==2.4.0
|
|||
soupsieve==2.5
|
||||
tldextract==5.1.2
|
||||
tomli==2.0.1
|
||||
typeguard==4.3.0
|
||||
typing_extensions==4.12.2
|
||||
urllib3==2.2.2
|
||||
vulture==2.11
|
||||
Werkzeug==3.0.3
|
||||
zipp==3.19.2
|
||||
zipp==3.20.0
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
cachetools==5.3.3
|
||||
cachetools==5.4.0
|
||||
chardet==5.2.0
|
||||
colorama==0.4.6
|
||||
distlib==0.3.8
|
||||
filelock==3.15.4
|
||||
packaging==24.1
|
||||
pip==24.1.2
|
||||
pip==24.2
|
||||
platformdirs==4.2.2
|
||||
pluggy==1.5.0
|
||||
pyproject-api==1.7.1
|
||||
setuptools==70.3.0
|
||||
setuptools==72.1.0
|
||||
tomli==2.0.1
|
||||
tox==4.16.0
|
||||
tox==4.17.1
|
||||
virtualenv==20.26.3
|
||||
wheel==0.43.0
|
||||
wheel==0.44.0
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# This file is automatically generated by scripts/dev/recompile_requirements.py
|
||||
|
||||
pathspec==0.12.1
|
||||
PyYAML==6.0.1
|
||||
PyYAML==6.0.2
|
||||
yamllint==1.35.1
|
||||
|
|
|
|||
|
|
@ -1264,7 +1264,7 @@ class DownloadModel(QAbstractListModel):
|
|||
else:
|
||||
return ""
|
||||
|
||||
def data(self, index, role):
|
||||
def data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) -> Any:
|
||||
"""Download data from DownloadManager."""
|
||||
if not index.isValid():
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
"""Handling of proxies."""
|
||||
|
||||
from typing import Optional
|
||||
from typing import Optional, List
|
||||
|
||||
from qutebrowser.qt.core import QUrl, pyqtSlot
|
||||
from qutebrowser.qt.network import QNetworkProxy, QNetworkProxyFactory
|
||||
from qutebrowser.qt.network import QNetworkProxy, QNetworkProxyFactory, QNetworkProxyQuery
|
||||
|
||||
from qutebrowser.config import config, configtypes
|
||||
from qutebrowser.utils import message, usertypes, urlutils, utils, qtutils
|
||||
|
|
@ -71,7 +71,7 @@ class ProxyFactory(QNetworkProxyFactory):
|
|||
capabilities &= ~lookup_cap
|
||||
proxy.setCapabilities(capabilities)
|
||||
|
||||
def queryProxy(self, query):
|
||||
def queryProxy(self, query: QNetworkProxyQuery = QNetworkProxyQuery()) -> List[QNetworkProxy]:
|
||||
"""Get the QNetworkProxies for a query.
|
||||
|
||||
Args:
|
||||
|
|
|
|||
|
|
@ -3,3 +3,21 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
"""Models for the command completion."""
|
||||
|
||||
from typing import Sequence, Optional
|
||||
from qutebrowser.completion.models.util import DeleteFuncType
|
||||
from qutebrowser.qt.core import QAbstractItemModel
|
||||
|
||||
|
||||
class BaseCategory(QAbstractItemModel):
|
||||
"""Abstract base class for categories of CompletionModels.
|
||||
|
||||
Extends QAbstractItemModel with a few attributes we expect to be present.
|
||||
|
||||
TODO: actually enforce that child classes set these variables, either via
|
||||
mypy (how) or turning these variables into abstract properties, eg https://stackoverflow.com/a/50381071
|
||||
"""
|
||||
|
||||
name: str
|
||||
columns_to_filter: Sequence[int]
|
||||
delete_func: Optional[DeleteFuncType] = None
|
||||
|
|
|
|||
|
|
@ -4,12 +4,20 @@
|
|||
|
||||
"""A model that proxies access to one or more completion categories."""
|
||||
|
||||
from typing import MutableSequence
|
||||
from typing import MutableSequence, overload, Optional, Any, cast
|
||||
|
||||
from qutebrowser.qt.core import Qt, QModelIndex, QAbstractItemModel
|
||||
from qutebrowser.qt import machinery
|
||||
from qutebrowser.qt.core import Qt, QModelIndex, QAbstractItemModel, QObject
|
||||
|
||||
from qutebrowser.utils import log, qtutils, utils
|
||||
from qutebrowser.api import cmdutils
|
||||
from qutebrowser.completion.models import BaseCategory
|
||||
|
||||
|
||||
if machinery.IS_QT5:
|
||||
_FlagType = Qt.ItemFlags
|
||||
else:
|
||||
_FlagType = Qt.ItemFlag
|
||||
|
||||
|
||||
class CompletionModel(QAbstractItemModel):
|
||||
|
|
@ -28,9 +36,9 @@ class CompletionModel(QAbstractItemModel):
|
|||
def __init__(self, *, column_widths=(30, 70, 0), parent=None):
|
||||
super().__init__(parent)
|
||||
self.column_widths = column_widths
|
||||
self._categories: MutableSequence[QAbstractItemModel] = []
|
||||
self._categories: MutableSequence[BaseCategory] = []
|
||||
|
||||
def _cat_from_idx(self, index):
|
||||
def _cat_from_idx(self, index: QModelIndex) -> Optional[BaseCategory]:
|
||||
"""Return the category pointed to by the given index.
|
||||
|
||||
Args:
|
||||
|
|
@ -44,11 +52,11 @@ class CompletionModel(QAbstractItemModel):
|
|||
return self._categories[index.row()]
|
||||
return None
|
||||
|
||||
def add_category(self, cat):
|
||||
def add_category(self, cat: BaseCategory) -> None:
|
||||
"""Add a completion category to the model."""
|
||||
self._categories.append(cat)
|
||||
|
||||
def data(self, index, role=Qt.ItemDataRole.DisplayRole):
|
||||
def data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) -> Any:
|
||||
"""Return the item data for index.
|
||||
|
||||
Override QAbstractItemModel::data.
|
||||
|
|
@ -74,7 +82,7 @@ class CompletionModel(QAbstractItemModel):
|
|||
idx = cat.index(index.row(), index.column())
|
||||
return cat.data(idx)
|
||||
|
||||
def flags(self, index):
|
||||
def flags(self, index: QModelIndex) -> _FlagType:
|
||||
"""Return the item flags for index.
|
||||
|
||||
Override QAbstractItemModel::flags.
|
||||
|
|
@ -82,16 +90,16 @@ class CompletionModel(QAbstractItemModel):
|
|||
Return: The item flags, or Qt.ItemFlag.NoItemFlags on error.
|
||||
"""
|
||||
if not index.isValid():
|
||||
return Qt.ItemFlag.NoItemFlags
|
||||
return cast(_FlagType, Qt.ItemFlag.NoItemFlags)
|
||||
if index.parent().isValid():
|
||||
# item
|
||||
return (Qt.ItemFlag.ItemIsEnabled | Qt.ItemFlag.ItemIsSelectable |
|
||||
Qt.ItemFlag.ItemNeverHasChildren)
|
||||
else:
|
||||
# category
|
||||
return Qt.ItemFlag.NoItemFlags
|
||||
return cast(_FlagType, Qt.ItemFlag.NoItemFlags)
|
||||
|
||||
def index(self, row, col, parent=QModelIndex()):
|
||||
def index(self, row: int, col: int, parent: QModelIndex = QModelIndex()) -> QModelIndex:
|
||||
"""Get an index into the model.
|
||||
|
||||
Override QAbstractItemModel::index.
|
||||
|
|
@ -108,7 +116,21 @@ class CompletionModel(QAbstractItemModel):
|
|||
return self.createIndex(row, col, self._categories[parent.row()])
|
||||
return self.createIndex(row, col, None)
|
||||
|
||||
def parent(self, index):
|
||||
@overload
|
||||
def parent(self, index: QModelIndex) -> QModelIndex:
|
||||
...
|
||||
|
||||
if machinery.IS_QT5:
|
||||
@overload
|
||||
def parent(self) -> QObject:
|
||||
...
|
||||
|
||||
else:
|
||||
@overload
|
||||
def parent(self) -> Optional[QObject]:
|
||||
...
|
||||
|
||||
def parent(self, index=None):
|
||||
"""Get an index to the parent of the given index.
|
||||
|
||||
Override QAbstractItemModel::parent.
|
||||
|
|
@ -116,6 +138,9 @@ class CompletionModel(QAbstractItemModel):
|
|||
Args:
|
||||
index: The QModelIndex to get the parent index for.
|
||||
"""
|
||||
if not index:
|
||||
return QObject.parent(self)
|
||||
|
||||
parent_cat = index.internalPointer()
|
||||
if not parent_cat:
|
||||
# categories have no parent
|
||||
|
|
|
|||
|
|
@ -18,11 +18,12 @@ from typing import List, Optional, Iterable
|
|||
|
||||
from qutebrowser.qt.core import QAbstractListModel, QModelIndex, QObject, Qt, QUrl
|
||||
|
||||
from qutebrowser.completion.models import BaseCategory
|
||||
from qutebrowser.config import config
|
||||
from qutebrowser.utils import log
|
||||
|
||||
|
||||
class FilePathCategory(QAbstractListModel):
|
||||
class FilePathCategory(QAbstractListModel, BaseCategory):
|
||||
"""Represent filesystem paths matching a pattern."""
|
||||
|
||||
def __init__(self, name: str, parent: QObject = None) -> None:
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ from qutebrowser.qt.widgets import QWidget
|
|||
from qutebrowser.misc import sql
|
||||
from qutebrowser.utils import debug, message, log
|
||||
from qutebrowser.config import config
|
||||
from qutebrowser.completion.models import util
|
||||
from qutebrowser.completion.models import util, BaseCategory
|
||||
|
||||
|
||||
class HistoryCategory(QSqlQueryModel):
|
||||
class HistoryCategory(QSqlQueryModel, BaseCategory):
|
||||
|
||||
"""A completion category that queries the SQL history store."""
|
||||
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ from qutebrowser.qt.core import QSortFilterProxyModel, QRegularExpression
|
|||
from qutebrowser.qt.gui import QStandardItem, QStandardItemModel
|
||||
from qutebrowser.qt.widgets import QWidget
|
||||
|
||||
from qutebrowser.completion.models import util
|
||||
from qutebrowser.completion.models import util, BaseCategory
|
||||
from qutebrowser.utils import qtutils, log
|
||||
|
||||
|
||||
class ListCategory(QSortFilterProxyModel):
|
||||
class ListCategory(QSortFilterProxyModel, BaseCategory):
|
||||
|
||||
"""Expose a list of items as a category for the CompletionModel."""
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,9 @@
|
|||
|
||||
from typing import Dict, Sequence
|
||||
|
||||
from qutebrowser.qt.core import QAbstractItemModel
|
||||
|
||||
from qutebrowser.completion.models import (completionmodel, filepathcategory,
|
||||
listcategory, histcategory)
|
||||
listcategory, histcategory,
|
||||
BaseCategory)
|
||||
from qutebrowser.browser import history
|
||||
from qutebrowser.utils import log, objreg
|
||||
from qutebrowser.config import config
|
||||
|
|
@ -59,7 +58,7 @@ def url(*, info):
|
|||
in sorted(config.val.url.searchengines.items())
|
||||
if k != 'DEFAULT']
|
||||
categories = config.val.completion.open_categories
|
||||
models: Dict[str, QAbstractItemModel] = {}
|
||||
models: Dict[str, BaseCategory] = {}
|
||||
|
||||
if searchengines and 'searchengines' in categories:
|
||||
models['searchengines'] = listcategory.ListCategory(
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
import os
|
||||
import signal
|
||||
import functools
|
||||
import logging
|
||||
import pathlib
|
||||
from typing import Optional, Sequence, Callable
|
||||
|
|
@ -60,10 +59,6 @@ def stop(tab: Optional[apitypes.Tab]) -> None:
|
|||
|
||||
def _print_preview(tab: apitypes.Tab) -> None:
|
||||
"""Show a print preview."""
|
||||
def print_callback(ok: bool) -> None:
|
||||
if not ok:
|
||||
message.error("Printing failed!")
|
||||
|
||||
tab.printing.check_preview_support()
|
||||
diag = QPrintPreviewDialog(tab)
|
||||
diag.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose)
|
||||
|
|
@ -71,8 +66,7 @@ def _print_preview(tab: apitypes.Tab) -> None:
|
|||
diag.windowFlags() |
|
||||
Qt.WindowType.WindowMaximizeButtonHint |
|
||||
Qt.WindowType.WindowMinimizeButtonHint)
|
||||
diag.paintRequested.connect(functools.partial(
|
||||
tab.printing.to_printer, callback=print_callback))
|
||||
diag.paintRequested.connect(tab.printing.to_printer)
|
||||
diag.exec()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ class CrashHandler(QObject):
|
|||
if sys.__stderr__ is not None:
|
||||
faulthandler.enable(sys.__stderr__)
|
||||
else:
|
||||
faulthandler.disable() # type: ignore[unreachable]
|
||||
faulthandler.disable()
|
||||
try:
|
||||
self._crash_log_file.close()
|
||||
os.remove(self._crash_log_file.name)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ def log_events(klass: Type[QObject]) -> Type[QObject]:
|
|||
return klass
|
||||
|
||||
|
||||
def log_signals(obj: QObject) -> QObject:
|
||||
def log_signals(obj: Union[QObject, Type[QObject]]) -> Union[QObject, Type[QObject]]:
|
||||
"""Log all signals of an object or class.
|
||||
|
||||
Can be used as class decorator.
|
||||
|
|
@ -80,6 +80,7 @@ def log_signals(obj: QObject) -> QObject:
|
|||
|
||||
obj.__init__ = new_init
|
||||
else:
|
||||
assert isinstance(obj, QObject)
|
||||
connect_log_slot(obj)
|
||||
|
||||
return obj
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ def _init_handlers(
|
|||
force_color: bool,
|
||||
json_logging: bool,
|
||||
ram_capacity: int
|
||||
) -> Tuple["logging.StreamHandler[TextIO]", Optional['RAMHandler']]:
|
||||
) -> Tuple[Optional["logging.StreamHandler[TextIO]"], Optional['RAMHandler']]:
|
||||
"""Init log handlers.
|
||||
|
||||
Args:
|
||||
|
|
@ -255,7 +255,7 @@ def _init_handlers(
|
|||
level, color, force_color, json_logging)
|
||||
|
||||
if sys.stderr is None:
|
||||
console_handler = None # type: ignore[unreachable]
|
||||
console_handler = None
|
||||
else:
|
||||
strip = False if force_color else None
|
||||
if use_colorama:
|
||||
|
|
@ -293,9 +293,13 @@ def _init_formatters(
|
|||
level: int,
|
||||
color: bool,
|
||||
force_color: bool,
|
||||
json_logging: bool
|
||||
) -> Tuple[Union['JSONFormatter', 'ColoredFormatter'],
|
||||
'ColoredFormatter', 'HTMLFormatter', bool]:
|
||||
json_logging: bool,
|
||||
) -> Tuple[
|
||||
Union['JSONFormatter', Optional['ColoredFormatter']],
|
||||
'ColoredFormatter',
|
||||
'HTMLFormatter',
|
||||
bool,
|
||||
]:
|
||||
"""Init log formatters.
|
||||
|
||||
Args:
|
||||
|
|
@ -318,7 +322,7 @@ def _init_formatters(
|
|||
use_colorama = False
|
||||
|
||||
if sys.stderr is None:
|
||||
console_formatter = None # type: ignore[unreachable]
|
||||
console_formatter = None
|
||||
return console_formatter, ram_formatter, html_formatter, use_colorama
|
||||
|
||||
if json_logging:
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class ObjectRegistry(collections.UserDict): # type: ignore[type-arg]
|
|||
|
||||
super().__setitem__(name, obj)
|
||||
|
||||
def __delitem__(self, name: str) -> None:
|
||||
def __delitem__(self, name: _IndexType) -> None:
|
||||
"""Extend __delitem__ to disconnect the destroyed signal."""
|
||||
self._disconnect_destroyed(name)
|
||||
super().__delitem__(name)
|
||||
|
|
@ -101,7 +101,7 @@ class ObjectRegistry(collections.UserDict): # type: ignore[type-arg]
|
|||
pass
|
||||
del partial_objs[name]
|
||||
|
||||
def on_destroyed(self, name: str) -> None:
|
||||
def on_destroyed(self, name: _IndexType) -> None:
|
||||
"""Schedule removing of a destroyed QObject.
|
||||
|
||||
We don't remove the destroyed object immediately because it might still
|
||||
|
|
@ -111,7 +111,7 @@ class ObjectRegistry(collections.UserDict): # type: ignore[type-arg]
|
|||
log.destroy.debug("schedule removal: {}".format(name))
|
||||
QTimer.singleShot(0, functools.partial(self._on_destroyed, name))
|
||||
|
||||
def _on_destroyed(self, name: str) -> None:
|
||||
def _on_destroyed(self, name: _IndexType) -> None:
|
||||
"""Remove a destroyed QObject."""
|
||||
log.destroy.debug("removed: {}".format(name))
|
||||
if not hasattr(self, 'data'):
|
||||
|
|
|
|||
|
|
@ -265,16 +265,16 @@ def fake_io(write_func: Callable[[str], int]) -> Iterator[None]:
|
|||
old_stderr = sys.stderr
|
||||
fake_stderr = FakeIOStream(write_func)
|
||||
fake_stdout = FakeIOStream(write_func)
|
||||
sys.stderr = fake_stderr # type: ignore[assignment]
|
||||
sys.stdout = fake_stdout # type: ignore[assignment]
|
||||
sys.stderr = fake_stderr
|
||||
sys.stdout = fake_stdout
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
# If the code we did run did change sys.stdout/sys.stderr, we leave it
|
||||
# unchanged. Otherwise, we reset it.
|
||||
if sys.stdout is fake_stdout: # type: ignore[comparison-overlap]
|
||||
if sys.stdout is fake_stdout:
|
||||
sys.stdout = old_stdout
|
||||
if sys.stderr is fake_stderr: # type: ignore[comparison-overlap]
|
||||
if sys.stderr is fake_stderr:
|
||||
sys.stderr = old_stderr
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ importlib_resources==6.4.0 ; python_version=="3.8.*"
|
|||
Jinja2==3.1.4
|
||||
MarkupSafe==2.1.5
|
||||
Pygments==2.18.0
|
||||
PyYAML==6.0.1
|
||||
zipp==3.19.2
|
||||
PyYAML==6.0.2
|
||||
zipp==3.20.0
|
||||
# Unpinned due to recompile_requirements.py limitations
|
||||
pyobjc-core ; sys_platform=="darwin"
|
||||
pyobjc-framework-Cocoa ; sys_platform=="darwin"
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
"more-itertools": "https://github.com/more-itertools/more-itertools/blob/master/docs/versions.rst",
|
||||
"pydocstyle": "https://www.pydocstyle.org/en/latest/release_notes.html",
|
||||
"Sphinx": "https://www.sphinx-doc.org/en/master/changes.html",
|
||||
"Babel": "https://github.com/python-babel/babel/blob/master/CHANGES.rst",
|
||||
"babel": "https://github.com/python-babel/babel/blob/master/CHANGES.rst",
|
||||
"alabaster": "https://alabaster.readthedocs.io/en/latest/changelog.html",
|
||||
"imagesize": "https://github.com/shibukawa/imagesize_py/commits/master",
|
||||
"pytz": "https://mm.icann.org/pipermail/tz-announce/",
|
||||
|
|
@ -146,6 +146,11 @@
|
|||
"jaraco.classes": "https://jaracoclasses.readthedocs.io/en/latest/history.html",
|
||||
"jaraco.context": "https://jaracocontext.readthedocs.io/en/latest/history.html",
|
||||
"jaraco.functools": "https://jaracofunctools.readthedocs.io/en/latest/history.html",
|
||||
"jaraco.text": "https://jaracotext.readthedocs.io/en/latest/history.html",
|
||||
"autocommand": "https://github.com/Lucretiel/autocommand/releases",
|
||||
"inflect": "https://inflect.readthedocs.io/en/latest/history.html",
|
||||
"ordered-set": "https://github.com/rspeer/ordered-set/blob/master/CHANGELOG.md",
|
||||
"typeguard": "https://typeguard.readthedocs.io/en/latest/versionhistory.html",
|
||||
"backports.tarfile": "https://github.com/jaraco/backports.tarfile/blob/main/NEWS.rst",
|
||||
"pkginfo": "https://bazaar.launchpad.net/~tseaver/pkginfo/trunk/view/head:/CHANGES.txt",
|
||||
"readme_renderer": "https://github.com/pypa/readme_renderer/blob/main/CHANGES.rst",
|
||||
|
|
|
|||
Loading…
Reference in New Issue