From cf13c311428d7ea235503961b04b8cd46b30238b Mon Sep 17 00:00:00 2001 From: Philip Scheel Date: Tue, 4 Sep 2018 00:09:21 +0200 Subject: [PATCH] Resolved conflicts for merge, regenerated asciidoc, removed whitespace Removed whitespace --- doc/changelog.asciidoc | 9 +++-- doc/help/commands.asciidoc | 2 +- doc/help/settings.asciidoc | 34 ++++++++++++------- misc/requirements/requirements-codecov.txt | 2 +- misc/requirements/requirements-flake8.txt | 4 +-- misc/requirements/requirements-pip.txt | 2 +- .../requirements/requirements-pyinstaller.txt | 2 +- .../requirements-pylint-master.txt | 9 +++-- misc/requirements/requirements-pylint.txt | 9 +++-- misc/requirements/requirements-tests.txt | 16 ++++----- misc/requirements/requirements-tests.txt-raw | 2 +- misc/requirements/requirements-tox.txt | 4 +-- qutebrowser/__init__.py | 2 +- qutebrowser/completion/models/urlmodel.py | 2 +- qutebrowser/config/configcommands.py | 7 ++-- qutebrowser/config/configtypes.py | 2 +- qutebrowser/utils/urlmatch.py | 4 ++- requirements.txt | 2 +- tests/unit/config/test_configcommands.py | 18 +++++----- tests/unit/utils/test_urlmatch.py | 2 +- 20 files changed, 76 insertions(+), 58 deletions(-) diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index 8ffdc6a35..6c19e0e4f 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -37,9 +37,11 @@ Changed - The `app_id` is now set to `qutebrowser` for Wayland. - `Command` or `Cmd` can now be used (instead of `Meta`) to map the Command key on macOS. +- Using `:set option` now shows the value of the setting (like `:set option?` + already did). -v1.4.2 (unreleased) -------------------- +v1.4.2 +------ Changed ~~~~~~~ @@ -65,6 +67,8 @@ Fixed Note it still does not work on Qt 5.10 (due to a Qt bug) and Qt < 5.9.2. - Repeated escaping of entries in `qute://log` when refreshing page. - The host blocker doesn't block 0.0.0.0 anymore. +- Crash when using :// as URL pattern. +- The `:buffer` completion now sorts tabs with indices >= 10 correctly again. v1.4.1 ------ @@ -89,7 +93,6 @@ Fixed - The Windows installer now uninstalls the old version before installing the new one, fixing issues with qutebrowser not starting after installing v1.4.0 over v1.3.3. -- The `:buffer` completion now sorts tabs with indices >= 10 correctly again. v1.4.0 ------ diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 04cf5f318..4b4ad54bc 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -1139,7 +1139,7 @@ Syntax: +:set [*--temp*] [*--print*] [*--pattern* 'pattern'] ['option'] ['value' Set an option. -If the option name ends with '?', the value of the option is shown instead. Using :set without any arguments opens a page where settings can be changed interactively. +If the option name ends with '?' or no value is provided, the value of the option is shown instead. Using :set without any arguments opens a page where settings can be changed interactively. ==== positional arguments * +'option'+: The name of the option. diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index ef06ce7e6..f0425cfa7 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -100,6 +100,7 @@ |<>|Delay (in milliseconds) before updating completions after typing a character. |<>|Height (in pixels or as percentage of the window) of the completion. |<>|Minimum amount of characters needed to update completions. +|<>|Which categories to show (in which order) in the :open completion. |<>|Move on to the next part when there's only one possible completion left. |<>|Padding (in pixels) of the scrollbar handle in the completion window. |<>|Width (in pixels) of the scrollbar in the completion window. @@ -268,7 +269,6 @@ |<>|Page to open if :open -t/-b/-w is used without URL. |<>|URL segments where `:navigate increment/decrement` will search for a number. |<>|Open base URL of the searchengine if a searchengine shortcut is invoked without parameters. -|<>|Which categories should be shown in the :open dialogue. |<>|Search engines which can be used via the address bar. |<>|Page(s) to open at the start. |<>|URL parameters to strip with `:yank url`. @@ -1386,6 +1386,26 @@ Type: <> Default: +pass:[1]+ +[[completion.open_categories]] +=== completion.open_categories +Which categories to show (in which order) in the :open completion. + +Type: <> + +Valid values: + + * +searchengines+ + * +quickmarks+ + * +bookmarks+ + * +history+ + +Default: + +- +pass:[searchengines]+ +- +pass:[quickmarks]+ +- +pass:[bookmarks]+ +- +pass:[history]+ + [[completion.quick]] === completion.quick Move on to the next part when there's only one possible completion left. @@ -3274,18 +3294,6 @@ Type: <> Default: +pass:[false]+ -[[url.open_categories_shown]] -=== url.open_categories_shown -Which categories should be shown in the :open dialogue. - -Type: <> - -Default -- +pass:[bookmarks]+ -- +pass:[searchengines]+ -- +pass:[history]+ -- +pass:[quickmarks]+ - [[url.searchengines]] === url.searchengines Search engines which can be used via the address bar. diff --git a/misc/requirements/requirements-codecov.txt b/misc/requirements/requirements-codecov.txt index 8438d8d6d..efd023ea6 100644 --- a/misc/requirements/requirements-codecov.txt +++ b/misc/requirements/requirements-codecov.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -certifi==2018.8.13 +certifi==2018.8.24 chardet==3.0.4 codecov==2.0.15 coverage==4.5.1 diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index c2f721fdf..8ae3ac64d 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -attrs==18.1.0 +attrs==18.2.0 flake8==3.5.0 flake8-bugbear==18.8.0 flake8-builtins==1.4.1 # rq.filter: != 1.4.0 @@ -24,4 +24,4 @@ pydocstyle==2.1.1 pyflakes==2.0.0 six==1.11.0 snowballstemmer==1.2.1 -typing==3.6.4 +typing==3.6.6 diff --git a/misc/requirements/requirements-pip.txt b/misc/requirements/requirements-pip.txt index 00e25abed..a399c0b47 100644 --- a/misc/requirements/requirements-pip.txt +++ b/misc/requirements/requirements-pip.txt @@ -3,6 +3,6 @@ appdirs==1.4.3 packaging==17.1 pyparsing==2.2.0 -setuptools==40.1.0 +setuptools==40.2.0 six==1.11.0 wheel==0.31.1 diff --git a/misc/requirements/requirements-pyinstaller.txt b/misc/requirements/requirements-pyinstaller.txt index 8882ead87..aa9aebeb6 100644 --- a/misc/requirements/requirements-pyinstaller.txt +++ b/misc/requirements/requirements-pyinstaller.txt @@ -2,6 +2,6 @@ altgraph==0.16.1 future==0.16.0 -macholib==1.10 +macholib==1.11 pefile==2018.8.8 PyInstaller==3.3.1 diff --git a/misc/requirements/requirements-pylint-master.txt b/misc/requirements/requirements-pylint-master.txt index 2354aa7af..6386505fc 100644 --- a/misc/requirements/requirements-pylint-master.txt +++ b/misc/requirements/requirements-pylint-master.txt @@ -1,13 +1,18 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py +asn1crypto==0.24.0 -e git+https://github.com/PyCQA/astroid.git#egg=astroid -certifi==2018.8.13 +certifi==2018.8.24 +cffi==1.11.5 chardet==3.0.4 -github3.py==1.1.0 +cryptography==2.3.1 +github3.py==1.2.0 idna==2.7 isort==4.3.4 +jwcrypto==0.5.0 lazy-object-proxy==1.3.1 mccabe==0.6.1 +pycparser==2.18 -e git+https://github.com/PyCQA/pylint.git#egg=pylint python-dateutil==2.7.3 ./scripts/dev/pylint_checkers diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index d28cba076..695e98a47 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,13 +1,18 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py +asn1crypto==0.24.0 astroid==2.0.4 -certifi==2018.8.13 +certifi==2018.8.24 +cffi==1.11.5 chardet==3.0.4 -github3.py==1.1.0 +cryptography==2.3.1 +github3.py==1.2.0 idna==2.7 isort==4.3.4 +jwcrypto==0.5.0 lazy-object-proxy==1.3.1 mccabe==0.6.1 +pycparser==2.18 pylint==2.1.1 python-dateutil==2.7.3 ./scripts/dev/pylint_checkers diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index bfca4321f..c727ad736 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -1,10 +1,10 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -atomicwrites==1.1.5 -attrs==18.1.0 +atomicwrites==1.2.1 +attrs==18.2.0 backports.functools-lru-cache==1.5 beautifulsoup4==4.6.3 -cheroot==6.4.0 +cheroot==6.5.2 click==6.7 # colorama==0.3.9 coverage==4.5.1 @@ -13,7 +13,7 @@ fields==5.0.0 Flask==1.0.2 glob2==0.6 hunter==2.0.2 -hypothesis==3.69.0 +hypothesis==3.70.3 itsdangerous==0.24 # Jinja2==2.10 Mako==1.0.7 @@ -22,17 +22,17 @@ more-itertools==4.3.0 parse==1.8.4 parse-type==0.4.2 pluggy==0.7.1 -py==1.5.4 +py==1.6.0 py-cpuinfo==4.0.0 -pytest==3.6.4 # rq.filter: != 3.7, != 3.7.1, != 3.7.2 +pytest==3.6.4 # rq.filter: != 3.7, != 3.7.1, != 3.7.2, != 3.7.3, != 3.7.4 pytest-bdd==2.21.0 pytest-benchmark==3.1.1 pytest-cov==2.5.1 pytest-faulthandler==1.5.0 pytest-instafail==0.4.0 pytest-mock==1.10.0 -pytest-qt==3.0.0 -pytest-repeat==0.6.0 +pytest-qt==3.0.2 +pytest-repeat==0.7.0 pytest-rerunfailures==4.1 pytest-travis-fold==1.3.0 pytest-xvfb==1.1.0 diff --git a/misc/requirements/requirements-tests.txt-raw b/misc/requirements/requirements-tests.txt-raw index eac1381d4..2d1c378a1 100644 --- a/misc/requirements/requirements-tests.txt-raw +++ b/misc/requirements/requirements-tests.txt-raw @@ -19,4 +19,4 @@ pytest-xvfb vulture #@ ignore: Jinja2, MarkupSafe, colorama -#@ filter: pytest != 3.7, != 3.7.1, != 3.7.2 +#@ filter: pytest != 3.7, != 3.7.1, != 3.7.2, != 3.7.3, != 3.7.4 diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index 88dd1191d..398de75bf 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -1,9 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -packaging==17.1 pluggy==0.7.1 -py==1.5.4 -pyparsing==2.2.0 +py==1.6.0 six==1.11.0 tox==3.2.1 virtualenv==16.0.0 diff --git a/qutebrowser/__init__.py b/qutebrowser/__init__.py index fab8a5fae..e75b2755d 100644 --- a/qutebrowser/__init__.py +++ b/qutebrowser/__init__.py @@ -26,7 +26,7 @@ __copyright__ = "Copyright 2014-2018 Florian Bruhin (The Compiler)" __license__ = "GPL" __maintainer__ = __author__ __email__ = "mail@qutebrowser.org" -__version_info__ = (1, 4, 1) +__version_info__ = (1, 4, 2) __version__ = '.'.join(str(e) for e in __version_info__) __description__ = "A keyboard-driven, vim-like browser based on PyQt5." diff --git a/qutebrowser/completion/models/urlmodel.py b/qutebrowser/completion/models/urlmodel.py index 708caa258..aeb83cd51 100644 --- a/qutebrowser/completion/models/urlmodel.py +++ b/qutebrowser/completion/models/urlmodel.py @@ -87,5 +87,5 @@ def url(*, info): for category in categories: if category in models: model.add_category(models[category]) - + return model diff --git a/qutebrowser/config/configcommands.py b/qutebrowser/config/configcommands.py index 792eacaf0..10e16c370 100644 --- a/qutebrowser/config/configcommands.py +++ b/qutebrowser/config/configcommands.py @@ -85,8 +85,8 @@ class ConfigCommands: *, pattern=None): """Set an option. - If the option name ends with '?', the value of the option is shown - instead. + If the option name ends with '?' or no value is provided, the + value of the option is shown instead. Using :set without any arguments opens a page where settings can be changed interactively. @@ -116,8 +116,7 @@ class ConfigCommands: with self._handle_config_error(): if value is None: - raise cmdexc.CommandError("set: The following arguments " - "are required: value") + self._print_value(option, pattern=pattern) else: self._config.set_str(option, value, pattern=pattern, save_yaml=not temp) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 619dfd71d..7b7889ebe 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -123,7 +123,7 @@ class BaseType: """A type used for a setting value. Attributes: - none_ok: Whether to convert to None for an empty string. + none_ok: Whether to allow None (or an empty string for :set) as value. Class attributes: valid_values: Possible values if they can be expressed as a fixed diff --git a/qutebrowser/utils/urlmatch.py b/qutebrowser/utils/urlmatch.py index 02db96e33..79e02c37f 100644 --- a/qutebrowser/utils/urlmatch.py +++ b/qutebrowser/utils/urlmatch.py @@ -142,7 +142,9 @@ class UrlPattern: Deviation from Chromium: - We assume * when no scheme has been given. """ - assert parsed.scheme, parsed + if not parsed.scheme: + raise ParseError("Missing scheme") + if parsed.scheme == 'any': self._scheme = None return diff --git a/requirements.txt b/requirements.txt index b5328b5da..c54d143a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -attrs==18.1.0 +attrs==18.2.0 colorama==0.3.9 cssutils==1.0.2 Jinja2==2.10 diff --git a/tests/unit/config/test_configcommands.py b/tests/unit/config/test_configcommands.py index 77097d851..f70586152 100644 --- a/tests/unit/config/test_configcommands.py +++ b/tests/unit/config/test_configcommands.py @@ -61,13 +61,14 @@ class TestSet: commands.set(win_id=0) assert tabbed_browser_stubs[0].opened_url == QUrl('qute://settings') - def test_get(self, config_stub, commands, message_mock): - """Run ':set url.auto_search?'. + @pytest.mark.parametrize('option', ['url.auto_search?', 'url.auto_search']) + def test_get(self, config_stub, commands, message_mock, option): + """Run ':set url.auto_search?' / ':set url.auto_search'. Should show the value. """ config_stub.val.url.auto_search = 'never' - commands.set(win_id=0, option='url.auto_search?') + commands.set(win_id=0, option=option) msg = message_mock.getmsg(usertypes.MessageLevel.info) assert msg.text == 'url.auto_search = never' @@ -183,17 +184,14 @@ class TestSet: "not available with the QtWebEngine backend!"): commands.set(0, 'hints.find_implementation', 'javascript') - @pytest.mark.parametrize('option', ['?', 'url.auto_search']) - def test_empty(self, commands, option): - """Run ':set ?' / ':set url.auto_search'. + def test_empty(self, commands): + """Run ':set ?'. Should show an error. See https://github.com/qutebrowser/qutebrowser/issues/1109 """ - with pytest.raises(cmdexc.CommandError, - match="The following arguments are required: " - "value"): - commands.set(win_id=0, option=option) + with pytest.raises(cmdexc.CommandError, match="No option '?'"): + commands.set(win_id=0, option='?') def test_toggle(self, commands): """Try toggling a value. diff --git a/tests/unit/utils/test_urlmatch.py b/tests/unit/utils/test_urlmatch.py index b77588469..e569c51b8 100644 --- a/tests/unit/utils/test_urlmatch.py +++ b/tests/unit/utils/test_urlmatch.py @@ -96,7 +96,7 @@ from qutebrowser.utils import urlmatch ("http://[fc2e:bb88:edac]", 'Invalid IPv6 address; source was "fc2e:bb88:edac"; host = ""'), ("http://[fc2e:bb88:edac::z]", 'Invalid IPv6 address; source was "fc2e:bb88:edac::z"; host = ""'), ("http://[fc2e:bb88:edac::2]:2a2", "Invalid port: invalid literal for int() with base 10: '2a2'"), - + ("://", "Missing scheme"), ]) def test_invalid_patterns(pattern, error): with pytest.raises(urlmatch.ParseError, match=re.escape(error)):