Fix lint
This commit is contained in:
parent
98543af57b
commit
a3279772d5
@ -27,6 +27,7 @@ from qutebrowser.extensions.interceptors import Request
|
|||||||
def register(interceptor: interceptors.InterceptorType) -> None:
|
def register(interceptor: interceptors.InterceptorType) -> None:
|
||||||
"""Register a request interceptor.
|
"""Register a request interceptor.
|
||||||
|
|
||||||
Whenever a request happens, the interceptor gets called with a Request object.
|
Whenever a request happens, the interceptor gets called with a Request
|
||||||
|
object.
|
||||||
"""
|
"""
|
||||||
interceptors.register(interceptor)
|
interceptors.register(interceptor)
|
||||||
|
@ -109,7 +109,7 @@ class HostBlocker:
|
|||||||
self._config_hosts_file = str(config_dir / 'blocked-hosts')
|
self._config_hosts_file = str(config_dir / 'blocked-hosts')
|
||||||
|
|
||||||
def _is_blocked(self, request_url: QUrl,
|
def _is_blocked(self, request_url: QUrl,
|
||||||
first_party_url: QUrl = None) -> None:
|
first_party_url: QUrl = None) -> bool:
|
||||||
"""Check whether the given request is blocked."""
|
"""Check whether the given request is blocked."""
|
||||||
if first_party_url is not None and not first_party_url.isValid():
|
if first_party_url is not None and not first_party_url.isValid():
|
||||||
first_party_url = None
|
first_party_url = None
|
||||||
|
@ -87,7 +87,7 @@ def add_module_info(module: types.ModuleType) -> ModuleInfo:
|
|||||||
return module.__qute_module_info # type: ignore
|
return module.__qute_module_info # type: ignore
|
||||||
|
|
||||||
|
|
||||||
def load_components(*, skip_hooks=False) -> None:
|
def load_components(*, skip_hooks: bool = False) -> None:
|
||||||
"""Load everything from qutebrowser.components."""
|
"""Load everything from qutebrowser.components."""
|
||||||
for info in walk_components():
|
for info in walk_components():
|
||||||
_load_component(info, skip_hooks=skip_hooks)
|
_load_component(info, skip_hooks=skip_hooks)
|
||||||
@ -143,7 +143,7 @@ def _get_init_context() -> InitContext:
|
|||||||
|
|
||||||
|
|
||||||
def _load_component(info: ExtensionInfo, *,
|
def _load_component(info: ExtensionInfo, *,
|
||||||
skip_hooks=False) -> types.ModuleType:
|
skip_hooks: bool = False) -> types.ModuleType:
|
||||||
"""Load the given extension and run its init hook (if any).
|
"""Load the given extension and run its init hook (if any).
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -75,6 +75,7 @@ def test_get_init_context(data_tmpdir, config_tmpdir, fake_args):
|
|||||||
|
|
||||||
|
|
||||||
def test_add_module_info():
|
def test_add_module_info():
|
||||||
|
# pylint: disable=no-member
|
||||||
mod = types.ModuleType('testmodule')
|
mod = types.ModuleType('testmodule')
|
||||||
info1 = loader.add_module_info(mod)
|
info1 = loader.add_module_info(mod)
|
||||||
assert mod.__qute_module_info is info1
|
assert mod.__qute_module_info is info1
|
||||||
|
Loading…
Reference in New Issue
Block a user