Commit Graph

9405 Commits

Author SHA1 Message Date
Florian Bruhin
6bc771151f Make walking components work for PyInstaller
Closes https://github.com/qutebrowser/qutebrowser-extensions/issues/5
2018-12-10 12:37:58 +01:00
Florian Bruhin
15e9127fa0 Add components to pyinstaller hiddenimports 2018-12-10 12:37:58 +01:00
Florian Bruhin
fcb39c1d7f Add types to extensions.loader 2018-12-10 12:37:58 +01:00
Florian Bruhin
411c5171a2 Load components dynamically 2018-12-10 12:37:58 +01:00
Florian Bruhin
735e6123cd Fix lint 2018-12-10 12:37:49 +01:00
Florian Bruhin
b9cb98a5ef mypy: Add types for config.websettings 2018-12-05 17:48:56 +01:00
Florian Bruhin
a9c1fc665f Fix configtypes.Perc.to_str()
If we used an int/float in config.py for a Perc value (e.g. zoom.default),
to_str() returned int/float instead of str, causing qWarnings and bugs.
2018-12-05 17:15:57 +01:00
Florian Bruhin
f53fd56c3d mypy: Add annotations for qutebrowser.config.configtypes 2018-12-05 17:06:45 +01:00
Florian Bruhin
403e63d6f2 Configure coverage.py for "if MYPY:" 2018-12-05 09:05:32 +01:00
Florian Bruhin
c752ba4721 Fix coverage 2018-12-05 08:55:35 +01:00
Florian Bruhin
2770a935e9 Properly fix zoom handling 2018-12-05 07:57:21 +01:00
Florian Bruhin
8a107fa5b3 Fix int_level handling in :zoom 2018-12-04 17:38:50 +01:00
Florian Bruhin
b5a6a5ab8c Merge remote-tracking branch 'origin/pr/4451' 2018-12-04 16:43:25 +01:00
Florian Bruhin
2cb277afd7 Fix exception messages in Command
The messages weren't updated in ac78039171.
2018-12-04 16:30:01 +01:00
Florian Bruhin
268ad40982 Add and enforce types for api.*/components.* 2018-12-04 15:52:14 +01:00
Florian Bruhin
71f9c5d206 Fix handling of annotated varargs in commands
When we have something like "*values: str" in :config-cycle, we get a list of
values, but the type converter assumes it's a string.

We could implement proper conversion of *args, but for now, let's just make
sure it's always a string.
2018-12-03 15:55:04 +01:00
Florian Bruhin
13dac9eef5 Revert "Revert "Add types for most of qutebrowser.config""
This reverts commit 7494d238ce.
2018-12-03 15:36:21 +01:00
Florian Bruhin
7494d238ce Revert "Add types for most of qutebrowser.config"
It breaks 'tsh' because of the *values annotation.
This reverts commit 208d3db475.
2018-12-03 13:17:23 +01:00
Florian Bruhin
208d3db475 Add types for most of qutebrowser.config 2018-12-03 12:35:51 +01:00
Florian Bruhin
b0ae4deac8 ADjust check_coverage for api/ 2018-12-03 08:49:10 +01:00
Florian Bruhin
a47ee08a84 Fix wrong/missing argument annotations 2018-12-03 08:45:13 +01:00
Florian Bruhin
ede13c76d9 Fix checking for count in src2asciidoc 2018-12-03 08:44:35 +01:00
Florian Bruhin
ef5e5d84ac Add assert for Command.pos_args 2018-12-03 08:44:10 +01:00
user202729
e81f070a79 Use tojson filter to convert url to Javascript string
Fixes #4450.
2018-12-02 22:56:44 +07:00
Florian Bruhin
4d8c8a5d92 Fix :home with pinned tabs 2018-11-30 16:58:33 +01:00
Florian Bruhin
a7a8f4470b Make ExternalEditor slots private 2018-11-30 16:57:48 +01:00
Florian Bruhin
d484d9363e Fix caret cmds 2018-11-30 16:52:17 +01:00
Florian Bruhin
a0dca95310 Move Command._handle_special_call_arg out of _get_call_args 2018-11-30 16:35:40 +01:00
Florian Bruhin
23d0dbd998 Fix handling of optional values in _add_special_arg
That way, we can pass None as a valid value.
2018-11-30 16:28:43 +01:00
Florian Bruhin
34aaca2aa0 Fix lint 2018-11-30 16:25:19 +01:00
Florian Bruhin
bfa518896a Fix Command.takes_count
Before, what this actually did was checking the .count argument of
a string (the *keys* in self._qute_args). Therefore, it always returned True as
soon as a command had any @cmdutils.argument decorator.
2018-11-30 16:23:34 +01:00
Florian Bruhin
979be017c3 Add components.misccommands 2018-11-30 15:56:16 +01:00
Florian Bruhin
7788a91ed2 Add CommandValue.count_tab 2018-11-30 15:55:50 +01:00
Florian Bruhin
2ef82caa10 apitypes: Expose webelem.Error/ClickTarget/JsWorld 2018-11-30 15:55:05 +01:00
Florian Bruhin
3abc83d945 Rename CommandValue.tab to CommandValue.cur_tab 2018-11-30 15:43:14 +01:00
Florian Bruhin
3a7206bda1 Make standarddir.Location private 2018-11-30 15:36:54 +01:00
Florian Bruhin
ba03e9394a Move zoom commands to components/ 2018-11-30 14:46:00 +01:00
Florian Bruhin
da505c84c6 Expose config.val to extension API 2018-11-30 14:46:00 +01:00
Florian Bruhin
a09b1a4e05 Move caret commands to components.caretcommands 2018-11-30 14:46:00 +01:00
Florian Bruhin
7a379ebec1 Expose KeyMode to extension API 2018-11-30 14:45:55 +01:00
Florian Bruhin
bc0ac62087 Rename api.tab.Tab to api.apitypes.Tab
Then we can add other related types there, and we don't clash with the common
"tab" argument for a new tab.
2018-11-30 14:28:29 +01:00
Florian Bruhin
88205a8d32 Add AbstractScroller.before_jump_requested signal
This allows us to save the ' mark without needing access to the TabbedBrowser
object.

This also changes the places the ' mark is saved slightly:

- :navigate doesn't save it anymore as there is no reason to do so (loading the
  new page will render the mark useless anyways).
- When clearing a search, the ' mark isn't saved.
- :scroll-anchor now saves the ' mark.
2018-11-30 14:17:40 +01:00
Florian Bruhin
e6c6e0dd59 Move scroll commands to components/ 2018-11-30 14:06:25 +01:00
Florian Bruhin
ce3b1f252d Add api.message and api.tab 2018-11-30 13:58:26 +01:00
Florian Bruhin
c0d4fe0ab5 Make it possible to inject tab via cmdutils.Value 2018-11-30 13:14:58 +01:00
Florian Bruhin
4ce8a6eaf6 Mark unreachable 2018-11-30 13:09:13 +01:00
Florian Bruhin
4e56d0e8b3 Refactor Command._get_self_arg 2018-11-30 13:06:53 +01:00
Florian Bruhin
7a90340299 Unify _get_count_arg/_get_win_id_arg 2018-11-30 12:59:21 +01:00
Florian Bruhin
566304ab4e Fix lint 2018-11-30 12:51:54 +01:00
Florian Bruhin
fe6f627305 Add partial type annotations for utils.message 2018-11-30 12:51:26 +01:00
Florian Bruhin
8725ac6e66 Fix type of stack argument for utils.message 2018-11-30 12:49:57 +01:00
Florian Bruhin
569bb0fa09 Add cmdutils.Value instead of using count=True/win_id=True 2018-11-30 12:45:01 +01:00
Florian Bruhin
b3fa43a97c Fix broken test_on_tab_changed 2018-11-30 11:19:34 +01:00
Florian Bruhin
9c4ebb97d7 Fix refactoring issues 2018-11-30 11:19:34 +01:00
Florian Bruhin
536a7ef1e6 Move command registering to Command object 2018-11-30 09:51:45 +01:00
Florian Bruhin
e184ace8cb Fix lint 2018-11-30 09:47:25 +01:00
Florian Bruhin
5199681b41 Rename add_history_item 2018-11-30 08:45:45 +01:00
Florian Bruhin
a7f7607b4d Rename _openurl_prepare 2018-11-30 08:38:11 +01:00
Florian Bruhin
da5527f5ef Rename predicted_navigation 2018-11-30 08:37:29 +01:00
Florian Bruhin
6a27cd4e15 fixup 2018-11-30 08:35:56 +01:00
Florian Bruhin
f6c36ccbee Rename openurl to load_url
We still call the :open command openurl, but in the tab API and in
TabbedBrowser it's now called load_url.
2018-11-30 08:31:03 +01:00
Florian Bruhin
5bf0dffa95 Move history (de)serializing to a private_api object 2018-11-30 08:23:52 +01:00
Florian Bruhin
27ee3280b2 Separate success/error callbacks 2018-11-29 20:29:43 +01:00
Florian Bruhin
0104490978 Use enum values for load_status_changed 2018-11-29 19:44:48 +01:00
Florian Bruhin
a6d3a935d3 Use an enum for IgnoreCase 2018-11-29 19:40:20 +01:00
Florian Bruhin
2cd2c60a8b Rename key_press to fake_key_press 2018-11-29 19:30:28 +01:00
Florian Bruhin
7a3d1b0212 AbstractHistory: Check count 2018-11-29 19:28:11 +01:00
Florian Bruhin
b2796d4a85 Rename some AbstractZoom methods 2018-11-29 19:26:05 +01:00
Florian Bruhin
73e196ff65 Make url(requested=True) a keyword-only arg 2018-11-29 19:23:14 +01:00
Florian Bruhin
cd8e3094b9 Avoid circular import 2018-11-29 19:22:28 +01:00
Florian Bruhin
609b8f1cee Fix return values of AbstractPrinting.check_*_support 2018-11-29 19:10:47 +01:00
Florian Bruhin
f81c5b7eab Move common key_press implementation 2018-11-29 19:10:19 +01:00
Florian Bruhin
4b7c60da9f Improve docstrings 2018-11-29 19:08:48 +01:00
Florian Bruhin
595e152729 Remove AbstractAudio.toggle_muted 2018-11-29 19:03:45 +01:00
Florian Bruhin
c7179e35cc Remove old code 2018-11-29 19:02:36 +01:00
Florian Bruhin
6ccba16b72 Fix coverage 2018-11-29 19:02:03 +01:00
Florian Bruhin
b7de287e7b Move CommandError to api.cmdutils 2018-11-29 14:18:11 +01:00
Florian Bruhin
f9858733c1 Improve docstrings 2018-11-29 14:18:11 +01:00
Florian Bruhin
e576847b91 Add partial type annotations for qtutils 2018-11-29 14:18:11 +01:00
Florian Bruhin
7cbba4b3f1 Add type annotations for cmdutils 2018-11-29 14:18:11 +01:00
Florian Bruhin
19628d0ae9 Move cmdutils.cmd_dict to objects.commands 2018-11-29 14:18:11 +01:00
Florian Bruhin
4caa2e056b Add type annotations to misc.objects 2018-11-29 14:18:11 +01:00
Thorsten Wißmann
65c51931c7 Wrap url quoting into new line 2018-11-29 08:29:56 +01:00
Thorsten Wißmann
31a122e97b Encode slashes in search terms for searchengines
If a search term contains a slash, this should be encoded. While this
makes no differences for search engines of the form

    http://example.org?q={}

it does for engines like these:

    http://example.org/search/{}

For a real world example, try:

    https://www.doi2bib.org/bib/{}
2018-11-29 08:29:56 +01:00
Florian Bruhin
ee2461a6fe Fix accessing user_agent() 2018-11-28 21:57:01 +01:00
Florian Bruhin
1d4729c7f7 Fix shutdown call 2018-11-28 19:56:52 +01:00
Florian Bruhin
89650d89f1 Fix lint 2018-11-28 18:03:10 +01:00
Florian Bruhin
5f5f202098 Move private tab API into an own object 2018-11-28 17:59:27 +01:00
Florian Bruhin
d60dff2623 Renaem private attribute to is_private 2018-11-28 17:34:33 +01:00
Florian Bruhin
8765ebef23 mypy: Don't claim to be a QWebEngineView 2018-11-28 16:06:25 +01:00
Florian Bruhin
63fa65df65
Merge pull request #4440 from qutebrowser/pyup-scheduled-update-2018-11-26
Scheduled weekly dependency update for week 47
2018-11-28 15:58:32 +01:00
Florian Bruhin
b5253ec473 Fix lint 2018-11-28 13:01:43 +01:00
Florian Bruhin
2237ca2bcf Remove now unneeded pylint suppressions 2018-11-28 12:54:19 +01:00
Florian Bruhin
2453134011 Remove unnecessary pass statements 2018-11-28 12:51:53 +01:00
Florian Bruhin
d7786c694f Add type hints for qutebrowser.browser.browsertab 2018-11-27 20:45:37 +01:00
Florian Bruhin
caca60087f Fix coverage 2018-11-27 13:24:48 +01:00
Florian Bruhin
21edeca3e0 pylint: disable=unused-import for typing
Apparently marking modules as used based on type comments doesn't work with
Python 3.7:

https://github.com/PyCQA/pylint/issues/2345
https://github.com/python/typed_ast/issues/60
2018-11-27 09:56:23 +01:00
Florian Bruhin
c931654a8d Remove old exit status values
Those weren't used anymore since bc8176ff21.
Since the values were removed in v1.0.0 and never used since then, it seems
fine to re-use them in the future.
2018-11-27 08:57:49 +01:00
Florian Bruhin
80808ee9d2 Add docstring 2018-11-27 08:54:25 +01:00
Florian Bruhin
7934dc9a95 mypy: Fix assert location 2018-11-27 08:37:59 +01:00