Commit Graph

8081 Commits

Author SHA1 Message Date
Florian Bruhin
a5c08e23b6 Fix path to link.html in new tests 2016-05-20 17:21:05 +02:00
Florian Bruhin
ea1f46d542 Merge branch 'hints_clicking' of https://github.com/lahwaacz/qutebrowser into lahwaacz-hints_clicking 2016-05-20 17:09:16 +02:00
Florian Bruhin
2c42219b23 Don't autofollow hint when unfiltering w/ rapid
When we are in rapid mode with only one link, after following the hint, fire()
called filter_hints(None) to display all hints again. Then filter_hints tried
to follow that link, fire() tried to show all again, etc., leading to a
RecursionError.

Fixes #1513.

A test will be added via #1510.
2016-05-20 16:41:51 +02:00
Florian Bruhin
107934e4e1 bdd: Wait a bit in "No crash should happen" step
If we don't do this, the qutebrowser process will be terminated and exit
before it actually has a chance to crash.

See #1510
2016-05-20 16:03:52 +02:00
Florian Bruhin
7898507775 tox: Update pytest-mock to 1.0.0
Fix AttributeError with mocker.spy when spying on inherited methods
2016-05-20 13:10:48 +02:00
Florian Bruhin
d67bfc8c45 Merge branch 'rcorre-keyhint_fix' 2016-05-20 13:07:47 +02:00
Florian Bruhin
b934f8bc4e Fix lint 2016-05-20 13:07:36 +02:00
Ryan Roden-Corrent
b1440a1804 Implement utils.is_special_key.
The check `key.startswith('<') and key.endswith('>') is repeated many
times in code to check for a special key. Replace all these with a call
to the same function.
2016-05-19 20:48:48 -04:00
Ryan Roden-Corrent
5992b81850 Don't show keyhint if there are no hints.
Currently, the keyhint window is shown even if the keystring matches no
possible bindings. This causes an empty keyhint window to hang around
after entering hinting mode.

Instead, the window is now hidden if no bindings match the current
keystring.

Resolves #1507.
2016-05-19 07:02:23 -04:00
Florian Bruhin
93989c035f Merge branch 'rumpelsepp-master' 2016-05-18 23:55:49 +02:00
Florian Bruhin
01e2fb37a0 Regenerate authors 2016-05-18 23:55:43 +02:00
Florian Bruhin
2b0f780500 Merge branch 'master' of https://github.com/rumpelsepp/qutebrowser into rumpelsepp-master 2016-05-18 23:55:34 +02:00
Stefan Tatschner
2c7dc6ffcc Add invalid url to 'test_set_hover_url_encoded'
This covers the recently introduced code path, in 1c23815 (Fix crash
when hovering over an invalid URL, 2016-05-18) when hovering an
invalid URL.
2016-05-18 22:23:26 +02:00
Florian Bruhin
f02bcf256b Update changelog 2016-05-18 18:49:37 +02:00
Florian Bruhin
9111d1b10f Merge branch 'rcorre-command_binding_completion' 2016-05-18 18:48:56 +02:00
Florian Bruhin
b5f8e7306f Merge branch 'command_binding_completion' of https://github.com/rcorre/qutebrowser into rcorre-command_binding_completion 2016-05-18 18:47:13 +02:00
Florian Bruhin
aef952637d Try to fix broken yelo link in README
See #1497
2016-05-18 18:43:16 +02:00
Stefan Tatschner
1c238152f7 Fix crash when hovering over an invalid URL 2016-05-18 16:20:03 +02:00
Ryan Roden-Corrent
4dd1478d2c Use ', '.join instead of str.join(', ', ...). 2016-05-18 08:55:17 -04:00
Ryan Roden-Corrent
0a0f0feaec Update command completions when keyconf changes.
When a user changes keybindings, update the command completion model so
the new keybindings are shown.
2016-05-18 08:00:21 -04:00
Ryan Roden-Corrent
c050b4973b Show special keys last in command completion.
When showing the currently bound key in the misc column for command
completion, if the command has multiple bindings, show special bindings
(e.g. <ctrl-a>) after non-special bindings.
2016-05-18 07:54:06 -04:00
Ryan Roden-Corrent
06caee41b8 Clean up command_binding_completion.
- Add a space after the comman for multiple binding suggestions.
- Use defaultdict(list) instead of defaultdict(lambda: [])
- Move the pylint comment back to the top of the class
2016-05-18 07:46:27 -04:00
Florian Bruhin
dc975cfac0 Update docs 2016-05-18 08:24:20 +02:00
Florian Bruhin
db0e29ae1d Merge branch 'rcorre-keystring' 2016-05-18 07:38:08 +02:00
Florian Bruhin
213677d30a Update changelog 2016-05-18 07:37:20 +02:00
Florian Bruhin
5b65ec17fd Set Qt.RichText textFormat for KeyHintView 2016-05-18 07:35:56 +02:00
Florian Bruhin
5c8d1656ff Fix path to test_keyhints.py in check_coverage.py
utils -> misc
2016-05-18 07:34:40 +02:00
Florian Bruhin
d0af80fbd5 Merge branch 'keystring' of https://github.com/rcorre/qutebrowser into rcorre-keystring 2016-05-18 07:33:17 +02:00
Florian Bruhin
32c7518124 Merge branch 'Liambeguin-hint_inputs' 2016-05-18 07:31:00 +02:00
Florian Bruhin
9a0083ea65 Regenerate authors 2016-05-18 07:30:54 +02:00
Florian Bruhin
324fcfadb0 Merge branch 'hint_inputs' of https://github.com/Liambeguin/qutebrowser into Liambeguin-hint_inputs 2016-05-18 07:30:46 +02:00
Florian Bruhin
d837e3eb91 Merge branch 'forkbong-pretty-hover-url' 2016-05-18 07:28:39 +02:00
Florian Bruhin
6aed55f09d Update changelog 2016-05-18 07:28:28 +02:00
Florian Bruhin
3a29abc779 Regenerate authors 2016-05-18 07:27:38 +02:00
Florian Bruhin
02cbc2f986 Merge branch 'pretty-hover-url' of https://github.com/forkbong/qutebrowser into forkbong-pretty-hover-url 2016-05-18 07:27:30 +02:00
Florian Bruhin
43518a4624 Merge branch 'timeout_docs' of https://github.com/rcorre/qutebrowser into rcorre-timeout_docs 2016-05-18 07:26:12 +02:00
Florian Bruhin
e4d84b0bfc Simplify argparser.type_check
If the value isn't param.default, it will always be a string or a flag, as
type_conv never gets called when the function is called from Python.
2016-05-18 07:16:17 +02:00
Florian Bruhin
284d4e4b97 Only pass is_bool to Command._param_to_argparse_* 2016-05-18 06:55:27 +02:00
Florian Bruhin
a83bf9c3ee Simplify argparser.type_conv
Since we're not using those functions as argparse callbacks anymore, we
can write a normal function instead of factories, which simplifies
things a lot.
2016-05-18 06:55:27 +02:00
Florian Bruhin
8ba6a0f5a7 Update CONTRIBUTING with cmdutils changes 2016-05-18 06:55:27 +02:00
Florian Bruhin
c0d044447d Add tests for qutebrowser.utils.typing 2016-05-18 06:55:17 +02:00
Florian Bruhin
6ed9b6b13f Make sure typing.Union[str, int] gets handled
str always needs to be the last element checked as otherwise it'd always
win.
2016-05-18 06:55:17 +02:00
Florian Bruhin
a0d0b6464f Use typing.py-like annotations for command args
This means:

- An annotation like (int, str) is now typing.Union[int, str].
- utils.typing got expanded so it acts like the real typing.py, with
  issubclass() working properly with typing.Union and __union_params__
  being set.
- A literal string doesn't exist anymore as annotation, instead
  @cmdutils.argument now has a 'choices' argument which can be used like
  @cmdutils.argument('arg', choices=['val1', 'val2']).
- Argument validating/converting is now entirely handled by
  argparser.type_conv instead of relying on python's argparse, i.e.
  type/choices is now not passed to argparse anymore.
2016-05-18 06:55:17 +02:00
Florian Bruhin
cdcd276a1a Also use @cmdutils.argument for :bind
This was added in master and not updated when this branch was rebased on
master.
2016-05-18 06:55:17 +02:00
Florian Bruhin
3a33bc42a6 Add initial support for the typing module 2016-05-18 06:55:17 +02:00
Florian Bruhin
9694374673 Add test for cmd arg types 2016-05-18 06:55:17 +02:00
Florian Bruhin
bb8d0a8ee4 Fix long lines 2016-05-18 06:55:17 +02:00
Florian Bruhin
c33f0c3512 Use @cmdutils.argument for completions 2016-05-18 06:55:17 +02:00
Florian Bruhin
3ab40bbc23 Clear globals correctly for all cmdutils tests
TestArgument didn't clear the globals as the fixture was inside
TestRegister.

This means test_run_vulture failed in funny ways because run_vulture.py
generated a whitelist containing "<locals>" for commands:

    tests/unit/scripts/test_run_vulture.py:55: in run
        return run_vulture.run([str(e.basename) for e in files])
    scripts/dev/run_vulture.py:146: in run
        vult.scavenge(files + [whitelist_file.name])
    .tox/py35/lib/python3.5/site-packages/vulture.py:107: in scavenge
        self.scan(module_string)
    .tox/py35/lib/python3.5/site-packages/vulture.py:75: in scan
        node = ast.parse(node_string, filename=self.file)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    source = 'qutebrowser.browser.commands.CommandDispatcher.buffer\nqutebrowser.misc.savemanager.SaveManager.save_command\nqutebro...iidoc.UsageFormatter._get_default_metavar_for_positional\nscripts.dev.src2asciidoc.UsageFormatter._metavar_formatter\n'
    filename = '/tmp/tmp_ein2umn', mode = 'exec'

        def parse(source, filename='<unknown>', mode='exec'):
            """
            Parse the source into an AST node.
            Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
            """
    >       return compile(source, filename, mode, PyCF_ONLY_AST)
    E         File "/tmp/tmp_ein2umn", line 16
    E           test_cmdutils.TestArgument.test_wrong_order.<locals>.fun
    E                                                       ^
    E       SyntaxError: invalid syntax
2016-05-18 06:55:17 +02:00
Florian Bruhin
1611562271 Get rid of dict annotations 2016-05-18 06:55:17 +02:00