Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b46f15a995 | ||
|
|
57e9708940 | ||
|
|
0be44fd420 | ||
|
|
d9539ca6d8 | ||
|
|
a362efaa56 |
@@ -14,6 +14,17 @@ This project adheres to http://semver.org/[Semantic Versioning].
|
||||
// `Fixed` for any bug fixes.
|
||||
// `Security` to invite users to upgrade in case of vulnerabilities.
|
||||
|
||||
v0.5.1
|
||||
------
|
||||
|
||||
Fixed
|
||||
~~~~~
|
||||
|
||||
- Fixed completion for various config values when using `:set`.
|
||||
- Fixed config validation for various config values.
|
||||
- Prevented an error being logged when a website with HTTP authentication was
|
||||
opened on Windows.
|
||||
|
||||
v0.5.0
|
||||
------
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ __copyright__ = "Copyright 2014-2016 Florian Bruhin (The Compiler)"
|
||||
__license__ = "GPL"
|
||||
__maintainer__ = __author__
|
||||
__email__ = "mail@qutebrowser.org"
|
||||
__version_info__ = (0, 5, 0)
|
||||
__version_info__ = (0, 5, 1)
|
||||
__version__ = '.'.join(str(e) for e in __version_info__)
|
||||
__description__ = "A keyboard-driven, vim-like browser based on PyQt5 and QtWebKit."
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
"""Our own QNetworkAccessManager."""
|
||||
|
||||
import os
|
||||
import collections
|
||||
import netrc
|
||||
|
||||
@@ -244,7 +245,10 @@ class NetworkManager(QNetworkAccessManager):
|
||||
def on_authentication_required(self, reply, authenticator):
|
||||
"""Called when a website needs authentication."""
|
||||
user, password = None, None
|
||||
if not hasattr(reply, "netrc_used"):
|
||||
if not hasattr(reply, "netrc_used") and 'HOME' in os.environ:
|
||||
# We'll get an OSError by netrc if 'HOME' isn't available in
|
||||
# os.environ. We don't want to log that, so we prevent it
|
||||
# altogether.
|
||||
reply.netrc_used = True
|
||||
try:
|
||||
net = netrc.netrc()
|
||||
|
||||
@@ -258,6 +258,13 @@ class String(BaseType):
|
||||
self._basic_validation(value)
|
||||
if not value:
|
||||
return
|
||||
|
||||
if self.valid_values is not None:
|
||||
if value not in self.valid_values:
|
||||
raise configexc.ValidationError(
|
||||
value, "valid values: {}".format(', '.join(
|
||||
self.valid_values)))
|
||||
|
||||
if self.forbidden is not None and any(c in value
|
||||
for c in self.forbidden):
|
||||
raise configexc.ValidationError(value, "may not contain the chars "
|
||||
@@ -270,7 +277,10 @@ class String(BaseType):
|
||||
"long!".format(self.maxlen))
|
||||
|
||||
def complete(self):
|
||||
return self._completions
|
||||
if self._completions is not None:
|
||||
return self._completions
|
||||
else:
|
||||
return super().complete()
|
||||
|
||||
|
||||
class List(BaseType):
|
||||
|
||||
@@ -321,7 +321,7 @@ class TestDefaultConfig:
|
||||
If it did change, place a new qutebrowser-vx.y.z.conf in old_configs
|
||||
and then increment the version.
|
||||
"""
|
||||
assert qutebrowser.__version__ == '0.5.0'
|
||||
assert qutebrowser.__version__ == '0.5.1'
|
||||
|
||||
@pytest.mark.parametrize('filename',
|
||||
os.listdir(os.path.join(os.path.dirname(__file__), 'old_configs')),
|
||||
|
||||
@@ -305,6 +305,8 @@ class TestString:
|
||||
({'minlen': 2}, 'fo'),
|
||||
({'minlen': 2, 'maxlen': 3}, 'fo'),
|
||||
({'minlen': 2, 'maxlen': 3}, 'foo'),
|
||||
# valid_values
|
||||
({'valid_values': configtypes.ValidValues('fooo')}, 'fooo'),
|
||||
])
|
||||
def test_validate_valid(self, klass, kwargs, val):
|
||||
klass(**kwargs).validate(val)
|
||||
@@ -319,6 +321,8 @@ class TestString:
|
||||
({'maxlen': 2}, 'fob'),
|
||||
({'minlen': 2, 'maxlen': 3}, 'f'),
|
||||
({'minlen': 2, 'maxlen': 3}, 'fooo'),
|
||||
# valid_values
|
||||
({'valid_values': configtypes.ValidValues('blah')}, 'fooo'),
|
||||
])
|
||||
def test_validate_invalid(self, klass, kwargs, val):
|
||||
with pytest.raises(configexc.ValidationError):
|
||||
@@ -335,6 +339,15 @@ class TestString:
|
||||
def test_complete(self, klass, value):
|
||||
assert klass(completions=value).complete() == value
|
||||
|
||||
@pytest.mark.parametrize('valid_values, expected', [
|
||||
(configtypes.ValidValues('one', 'two'),
|
||||
[('one', ''), ('two', '')]),
|
||||
(configtypes.ValidValues(('1', 'one'), ('2', 'two')),
|
||||
[('1', 'one'), ('2', 'two')]),
|
||||
])
|
||||
def test_complete_valid_values(self, klass, valid_values, expected):
|
||||
assert klass(valid_values=valid_values).complete() == expected
|
||||
|
||||
|
||||
class TestList:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user