diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-12-22 18:34:16 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-12-22 19:20:49 +0100 |
commit | c52744a219df9e15103431fc61b2884bae9955f3 (patch) | |
tree | af62b8903e829029f01991431f42f06e99054443 | |
parent | 5ef774bb30d0d05a6424ba6b8d685c14dcf988ca (diff) | |
download | qutebrowser-c52744a219df9e15103431fc61b2884bae9955f3.tar.gz qutebrowser-c52744a219df9e15103431fc61b2884bae9955f3.zip |
Rename adblock component to hostblock
-rw-r--r-- | qutebrowser/components/adblockcommands.py | 4 | ||||
-rw-r--r-- | qutebrowser/components/hostblock.py (renamed from qutebrowser/components/adblock.py) | 0 | ||||
-rwxr-xr-x | scripts/dev/run_vulture.py | 4 | ||||
-rw-r--r-- | scripts/hostblock_blame.py | 4 | ||||
-rw-r--r-- | tests/unit/components/test_hostblock.py (renamed from tests/unit/components/test_adblock.py) | 6 |
5 files changed, 9 insertions, 9 deletions
diff --git a/qutebrowser/components/adblockcommands.py b/qutebrowser/components/adblockcommands.py index 4574650d3..e507a2b5c 100644 --- a/qutebrowser/components/adblockcommands.py +++ b/qutebrowser/components/adblockcommands.py @@ -20,7 +20,7 @@ """Commands relating to ad blocking.""" from qutebrowser.api import cmdutils -from qutebrowser.components import braveadblock, adblock +from qutebrowser.components import braveadblock, hostblock @cmdutils.register() @@ -28,4 +28,4 @@ def adblock_update() -> None: """Update block lists for both the host- and the Brave ad blocker.""" if braveadblock.ad_blocker is not None: braveadblock.ad_blocker.adblock_update() - adblock.host_blocker.adblock_update() + hostblock.host_blocker.adblock_update() diff --git a/qutebrowser/components/adblock.py b/qutebrowser/components/hostblock.py index e1ef88667..e1ef88667 100644 --- a/qutebrowser/components/adblock.py +++ b/qutebrowser/components/hostblock.py diff --git a/scripts/dev/run_vulture.py b/scripts/dev/run_vulture.py index 194381421..05fcc9134 100755 --- a/scripts/dev/run_vulture.py +++ b/scripts/dev/run_vulture.py @@ -135,9 +135,9 @@ def whitelist_generator(): # noqa: C901 yield 'scripts.importer.import_moz_places.places.row_factory' # component hooks - yield 'qutebrowser.components.adblock.on_lists_changed' + yield 'qutebrowser.components.hostblock.on_lists_changed' yield 'qutebrowser.components.braveadblock.on_lists_changed' - yield 'qutebrowser.components.adblock.on_method_changed' + yield 'qutebrowser.components.hostblock.on_method_changed' yield 'qutebrowser.components.braveadblock.on_method_changed' # used in type comments diff --git a/scripts/hostblock_blame.py b/scripts/hostblock_blame.py index c3da64729..7b5d787a3 100644 --- a/scripts/hostblock_blame.py +++ b/scripts/hostblock_blame.py @@ -27,7 +27,7 @@ import os.path import urllib.request sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) -from qutebrowser.components import adblock +from qutebrowser.components import hostblock from qutebrowser.config import configdata @@ -43,7 +43,7 @@ def main(): print("checking {}...".format(url)) raw_file = urllib.request.urlopen(url) byte_io = io.BytesIO(raw_file.read()) - f = adblock.get_fileobj(byte_io) + f = hostblock.get_fileobj(byte_io) for line in f: line = line.decode('utf-8') if sys.argv[1] in line: diff --git a/tests/unit/components/test_adblock.py b/tests/unit/components/test_hostblock.py index 5b83ddbd3..d1a65ade5 100644 --- a/tests/unit/components/test_adblock.py +++ b/tests/unit/components/test_hostblock.py @@ -27,7 +27,7 @@ import pytest from PyQt5.QtCore import QUrl -from qutebrowser.components import adblock +from qutebrowser.components import hostblock from qutebrowser.utils import urlmatch from helpers import utils @@ -64,7 +64,7 @@ URLS_TO_CHECK = ( @pytest.fixture def host_blocker_factory(config_tmpdir, data_tmpdir, download_stub, config_stub): def factory(): - return adblock.HostBlocker(config_dir=config_tmpdir, data_dir=data_tmpdir) + return hostblock.HostBlocker(config_dir=config_tmpdir, data_dir=data_tmpdir) return factory @@ -446,7 +446,7 @@ def test_invalid_utf8_compiled( config_stub.val.content.blocking.hosts.lists = [] # Make sure the HostBlocker doesn't delete blocked-hosts in __init__ - monkeypatch.setattr(adblock.HostBlocker, "update_files", lambda _self: None) + monkeypatch.setattr(hostblock.HostBlocker, "update_files", lambda _self: None) (config_tmpdir / "blocked-hosts").write_binary(b"https://www.example.org/\xa0") (data_tmpdir / "blocked-hosts").ensure() |