This commit is contained in:
Florian Bruhin 2016-08-09 17:28:14 +02:00
parent 2cbb147e33
commit fb3da578c5
14 changed files with 37 additions and 18 deletions

View File

@ -1185,14 +1185,13 @@ class CommandDispatcher:
current page's url.
"""
if url is None:
url = self._current_url().toString(QUrl.RemovePassword
| QUrl.FullyEncoded)
url = self._current_url().toString(QUrl.RemovePassword |
QUrl.FullyEncoded)
try:
objreg.get('bookmark-manager').delete(url)
except KeyError:
raise cmdexc.CommandError("Bookmark '{}' not found!".format(url))
@cmdutils.register(instance='command-dispatcher', hide=True,
scope='window')
def follow_selected(self, *, tab=False):

View File

@ -761,7 +761,7 @@ class HintManager(QObject):
only_visible=True)
def current_mode(self):
"""Returns the currently active hinting mode (or None otherwise)."""
"""Return the currently active hinting mode (or None otherwise)."""
if self._context is None:
return None

View File

@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""Implementation of :navigate"""
"""Implementation of :navigate."""
import posixpath

View File

@ -36,22 +36,30 @@ from qutebrowser.utils import objreg, utils
class Attribute(websettings.Attribute):
"""A setting set via QWebEngineSettings::setAttribute."""
GLOBAL_SETTINGS = QWebEngineSettings.globalSettings
ENUM_BASE = QWebEngineSettings
class Setter(websettings.Setter):
"""A setting set via QWebEngineSettings getter/setter methods."""
GLOBAL_SETTINGS = QWebEngineSettings.globalSettings
class NullStringSetter(websettings.NullStringSetter):
"""A setter for settings requiring a null QString as default."""
GLOBAL_SETTINGS = QWebEngineSettings.globalSettings
class StaticSetter(websettings.StaticSetter):
"""A setting set via static QWebEngineSettings getter/setter methods."""
GLOBAL_SETTINGS = QWebEngineSettings.globalSettings

View File

@ -34,22 +34,30 @@ from qutebrowser.utils import standarddir, objreg
class Attribute(websettings.Attribute):
"""A setting set via QWebSettings::setAttribute."""
GLOBAL_SETTINGS = QWebSettings.globalSettings
ENUM_BASE = QWebSettings
class Setter(websettings.Setter):
"""A setting set via QWebSettings getter/setter methods."""
GLOBAL_SETTINGS = QWebSettings.globalSettings
class NullStringSetter(websettings.NullStringSetter):
"""A setter for settings requiring a null QString as default."""
GLOBAL_SETTINGS = QWebSettings.globalSettings
class StaticSetter(websettings.StaticSetter):
"""A setting set via static QWebSettings getter/setter methods."""
GLOBAL_SETTINGS = QWebSettings.globalSettings

View File

@ -1270,7 +1270,7 @@ def data(readonly=False):
"Font used in the completion widget."),
('completion.category',
SettingValue(typ.Font(), 'bold ${completion}'),
SettingValue(typ.Font(), 'bold ${completion}'),
"Font used in the completion categories."),
('tabbar',

View File

@ -125,11 +125,11 @@ class BaseType:
self.valid_values = None
def get_name(self):
"""Get a name for the type for documentation"""
"""Get a name for the type for documentation."""
return self.__class__.__name__
def get_valid_values(self):
"""Get the type's valid values for documentation"""
"""Get the type's valid values for documentation."""
return self.valid_values
def _basic_validation(self, value):

View File

@ -60,11 +60,11 @@ def _missing_str(name, *, windows=None, pip=None, webengine=False):
blocks.append('<br />'.join(lines))
if webengine:
lines = [
'Note QtWebEngine is not available for some distributions '
('Note QtWebEngine is not available for some distributions '
'(like Debian/Ubuntu), so you need to start without '
'--backend webengine there.',
'QtWebEngine is currently unsupported with the OS X .app, see '
'https://github.com/The-Compiler/qutebrowser/issues/1692',
'--backend webengine there.'),
('QtWebEngine is currently unsupported with the OS X .app, see '
'https://github.com/The-Compiler/qutebrowser/issues/1692'),
]
else:
lines = ['<b>If you installed a qutebrowser package for your '

View File

@ -77,6 +77,7 @@ def download_open(quteproc):
cmd = '{} -c pass'.format(shlex.quote(sys.executable))
quteproc.send_cmd(':download-open {}'.format(cmd))
@bdd.when("I directly open the download")
def download_open_with_prompt(quteproc):
cmd = '{} -c pass'.format(shlex.quote(sys.executable))

View File

@ -26,6 +26,7 @@ import signal
import pytest
@pytest.mark.parametrize('cmd', [':quit', ':later 500 quit'])
def test_smoke(cmd, capfd):
if hasattr(sys, 'frozen'):

View File

@ -221,6 +221,7 @@ class TestSelectorsAndFilters:
elems = [e for e in elems if filterfunc(e)]
assert bool(elems) == matching
class TestWebKitElement:
"""Generic tests for WebKitElement.

View File

@ -96,30 +96,30 @@ def cmdutils_patch(monkeypatch, stubs):
@cmdutils.argument('option', completion=usertypes.Completion.option)
@cmdutils.argument('value', completion=usertypes.Completion.value)
def set_command(section_=None, option=None, value=None):
"""docstring!"""
"""docstring."""
pass
@cmdutils.argument('topic', completion=usertypes.Completion.helptopic)
def show_help(tab=False, bg=False, window=False, topic=None):
"""docstring!"""
"""docstring."""
pass
@cmdutils.argument('url', completion=usertypes.Completion.url)
@cmdutils.argument('count', count=True)
def openurl(url=None, implicit=False, bg=False, tab=False, window=False,
count=None):
"""docstring!"""
"""docstring."""
pass
@cmdutils.argument('win_id', win_id=True)
@cmdutils.argument('command', completion=usertypes.Completion.command)
def bind(key, win_id, command=None, *, mode='normal', force=False):
"""docstring!"""
"""docstring."""
# pylint: disable=unused-variable
pass
def tab_detach():
"""docstring!"""
"""docstring."""
pass
cmds = {

View File

@ -59,6 +59,7 @@ def _extract_model_data(model):
data.append(row)
return data
@pytest.mark.parametrize('pattern, data, expected', [
('foo', 'barfoobar', True),
('foo', 'barFOObar', True),

View File

@ -283,7 +283,7 @@ class TestKeyConfigParser:
('download-remove --all', 'download-clear'),
('hint links fill ":open {hint-url}"',
'hint links fill :open {hint-url}'),
'hint links fill :open {hint-url}'),
('hint links fill ":open -t {hint-url}"',
'hint links fill :open -t {hint-url}'),