Commit Graph

21632 Commits

Author SHA1 Message Date
Florian Bruhin 1a4fff1a42 doc: Switch URLs to https 2021-01-26 15:19:01 +01:00
Florian Bruhin eeb26a6aa8 Revert "Remove pkg_resources special casing for PyInstaller"
This reverts commit 6bb2b082c9.

I guess storing package data in qutebrowser/ would be the proper way,
but this doesn't actually work on macOS - there, the executable name is
already "qutebrowser"...
2021-01-26 14:31:01 +01:00
Florian Bruhin 6bb2b082c9 Remove pkg_resources special casing for PyInstaller
See #4467
2021-01-26 11:13:41 +01:00
Florian Bruhin 2f918b9876 scripts: Rename --no-asciidoc to --skip-docs
For consistency
2021-01-26 10:20:11 +01:00
Florian Bruhin 86863f8cd4 tests: Update properly for importlib_resources
See #4667
2021-01-26 10:17:25 +01:00
Florian Bruhin 68b81511e5 Add 'Copy URL' to download context menu
See #1078
2021-01-25 18:50:57 +01:00
Florian Bruhin 2d6d9e108e mypy: Update ignore comments 2021-01-25 11:18:23 +01:00
Florian Bruhin 4a9dea0aef tox: Don't run mypy over tests/
With https://github.com/python/mypy/pull/9614, mypy now tries to collect
all files in tests/, but it fails due to:

    tests/end2end/conftest.py: error: Duplicate module named 'conftest' (also at 'tests/end2end/features/conftest.py')
    tests/end2end/conftest.py: error: Are you missing an __init__.py?  [misc]

We should probably add __init__.py files to tests/ at some point...

See #6059 and #5249
2021-01-25 11:12:37 +01:00
qutebrowser bot 11f231f7aa Update dependencies 2021-01-25 05:11:04 +00:00
Florian Bruhin 41afe0febe Support Super as modifier name
See https://github.com/qutebrowser/qutebrowser/discussions/5999#discussioncomment-297309
2021-01-22 17:37:42 +01:00
Florian Bruhin 28a694e17c Add String.replaceAll polyfill
See #6047
2021-01-22 10:50:36 +01:00
Florian Bruhin 222f1f19a1 Bump copyright years
Closes #6015
2021-01-20 20:06:19 +01:00
Florian Bruhin 22890852b6 Update cheatsheet 2021-01-20 19:39:30 +01:00
Florian Bruhin 723bdf693f Various default setting changes
See #6022 and #5999
2021-01-20 19:35:57 +01:00
Florian Bruhin 25afb200ed Rename :enter-mode and :leave-mode
See #6022
2021-01-20 18:19:03 +01:00
Florian Bruhin fc87c3df0f Rename :follow-hint to :hint-follow
See #6022
2021-01-20 18:18:59 +01:00
Florian Bruhin c4c3702089 userscripts: Add QUTE_VERSION
See #937
2021-01-20 18:18:59 +01:00
Florian Bruhin 6e03a22482 Rename selection commands
See #6022
2021-01-20 18:00:38 +01:00
Florian Bruhin 7146c18183 Rename :open-editor to :edit-text
See #6022
2021-01-20 18:00:38 +01:00
Florian Bruhin fd6790fe8c Rename :buffer to :tab-select
See #6022
2021-01-20 18:00:38 +01:00
Florian Bruhin 487f90443c Rename :run-macro and :record-macro
See #6022
2021-01-20 18:00:38 +01:00
Florian Bruhin 673c0be179 completion: Avoid pathlib in filepathcategory
On GitHub Actions, it looks like there's a situation where
os.path.expanduser and pathlib.Path.expanduser disagree.

When in test_filesystem_completion_hypothesis the completion gets '~' as
input, it fails with:

    tests/unit/completion/test_models.py:469: in test_filesystem_completion_hypothesis
        model.set_pattern(text)
    qutebrowser/completion/models/filepathcategory.py:88: in set_pattern
        self._paths = sorted(self._contract_user(val, path) for path in paths)
    qutebrowser/completion/models/filepathcategory.py:88: in <genexpr>
        self._paths = sorted(self._contract_user(val, path) for path in paths)
    qutebrowser/completion/models/filepathcategory.py:52: in _contract_user
        return str(head / pathlib.Path(path).relative_to(head.expanduser()))
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = PosixPath('/home/runneradmin'), other = (PosixPath('/home/runner'),)
    parts = ['/', 'home', 'runneradmin'], drv = '', root = '/'

        def relative_to(self, *other):
            [...]
    E           ValueError: '/home/runneradmin' does not start with '/home/runner'

Let's use os.path everywhere, so we can be sure the two code paths agree
with each other.
2021-01-20 17:57:54 +01:00
Florian Bruhin 65c948d1e8 Fix lint 2021-01-20 14:41:30 +01:00
Florian Bruhin 2c382a761d config: Improve error handling for missing sections
When the user does something like this with the new adblocking config:

    c.content.host_blocking.lists = ...

Then we didn't notify her about the setting being renamed. Instead, she
got:

    While getting 'content.host_blocking': No option 'content.host_blocking'

    Unhandled exception: 'NoneType' object has no attribute 'lists'
    Traceback (most recent call last):
      File ".../qutebrowser/config/configfiles.py", line 805, in read_config_py
        exec(code, module.__dict__)
      File "/tmp/config.py", line 1, in <module>
        c.content.host_blocking.lists = []
    AttributeError: 'NoneType' object has no attribute 'lists'

This happens because we did something like (simplified):

    with self._handle_error(...):
        return self._config.get(...)
    # End of method

Thus, if there was an error, nothing is returned and the method ends,
therefore returning an implicit None. When then trying to access .lists
on that None, we get the AttributeError.

Instead, we now permit this kind of wrong usage in config.py files.
If this is a qutebrowser-internal ConfigContainer, we would've already
raised in _handle_error() anyways.

What we now do instead is returning a new ConfigContainer, i.e.
allowing further access (while still capturing the error message).
Thus, this now leads to:

    While getting 'content.host_blocking':
    No option 'content.host_blocking'

    While setting 'content.host_blocking.lists':
    No option 'content.host_blocking.lists'
    (this option was renamed to 'content.blocking.hosts.lists')

This still isn't optimal, but the best we can do without more magic:
At the point the first failure happens, we can't tell whether the user
wants to get an option or is just getting a prefix.

Fixes #5991
2021-01-20 14:12:39 +01:00
Florian Bruhin 729e098bae config: Add ConfigContainer._with_prefix() 2021-01-20 13:48:06 +01:00
Florian Bruhin f5d89fc9ba Handle null bytes in filepath completion 2021-01-20 12:04:51 +01:00
Florian Bruhin 6fd2077b6c Improve tests for filesystem completion 2021-01-20 10:30:25 +01:00
Florian Bruhin 12583d359e Update docs 2021-01-20 10:12:50 +01:00
Florian Bruhin fc07f2cbdf Refactor FilePathCategory 2021-01-20 10:12:50 +01:00
Florian Bruhin 88cd06c0b7 Minor reformat 2021-01-20 09:50:32 +01:00
Florian Bruhin 0fc6d1109d Merge remote-tracking branch 'origin/pr/6038' into dev 2021-01-20 09:46:29 +01:00
Andrew MacFie a0cc57d0fd Add some tests 2021-01-19 18:07:39 -05:00
Andrew MacFie 3b3529db7a Add favorite_paths as setting 2021-01-19 15:07:04 -05:00
Andrew MacFie a12378a31d Remove config import for now 2021-01-19 14:37:38 -05:00
Andrew MacFie c839e4124b Fix name from Qt 2021-01-19 14:32:06 -05:00
Andrew MacFie 907b41e9ff Fix method implementation 2021-01-19 14:17:37 -05:00
Andrew MacFie 51343a432b Add filesystem completion to default 2021-01-19 14:07:35 -05:00
Andrew MacFie 62d627757f Leave prefix as user typed it 2021-01-19 13:39:16 -05:00
Florian Bruhin 21b20116f5 Go back to a normal setup.py
For some reason, despite using "find:" for the package and this working
fine for the sdist, the qutebrowser-git Archlinux package doesn't
actually include any qutebrowser/ files anymore.

This currently really doesn't seem to be worth the trouble...

See #3526

This reverts commit 90323d1d98.
This reverts commit 21ee2fe882.
2021-01-19 19:14:55 +01:00
Florian Bruhin cbfce386d2 scripts: Allow skipping 32bit build 2021-01-19 18:13:28 +01:00
Florian Bruhin 21ee2fe882 Run setup-cfg-fmt
With a couple of manual adjustments for the license specifier
2021-01-19 18:13:28 +01:00
Florian Bruhin 90323d1d98 Switch to declarative setup.py metadata
Switches #3526
2021-01-19 18:13:28 +01:00
Andrew MacFie dd80110dd4 Fix some stuff 2021-01-19 11:51:17 -05:00
Florian Bruhin 30ef25b726 Update docs 2021-01-19 17:23:52 +01:00
Florian Bruhin 522eb29da8 Don't download favicons if disabled
Prompted by https://www.cs.uic.edu/~polakis/papers/solomos-ndss21.pdf
2021-01-19 17:22:36 +01:00
Florian Bruhin 5fc20471f9
Merge pull request #6048 from pastalian/default-fileselect
Change default fileselect commands
2021-01-19 16:32:28 +01:00
Takuya Wakazono 9e4825370b Change default fileselect commands 2021-01-20 00:24:34 +09:00
Andrew 8c9d9c74c8
Update qutebrowser/completion/models/filepathcategory.py
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2021-01-19 10:23:44 -05:00
Andrew e95e7991d9
Update qutebrowser/completion/models/filepathcategory.py
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2021-01-19 10:23:28 -05:00
Andrew 40f75d86bc
Update qutebrowser/completion/models/filepathcategory.py
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2021-01-19 10:23:09 -05:00