Commit Graph

320 Commits

Author SHA1 Message Date
Florian Bruhin
8bd64382bd Rename utils.qt to utils.qtutils. 2014-08-26 20:25:11 +02:00
Florian Bruhin
d9a8cbe7ad Rename utils.misc to utils.utils 2014-08-26 20:20:17 +02:00
Florian Bruhin
b4298c2922 Remove 'as logger' imports. 2014-08-26 20:15:41 +02:00
Florian Bruhin
d625cde28c Clean up imports 2014-08-26 19:10:14 +02:00
Florian Bruhin
984f984cf0 Fix lint. 2014-08-25 10:58:12 +02:00
Florian Bruhin
66e670a96b Fix ignore_case for searching. 2014-08-25 06:56:14 +02:00
Florian Bruhin
17dd4732ae Add explicit encoding to open() calls. 2014-08-20 20:33:14 +02:00
Florian Bruhin
5b915186d7 Add a 'smart' option for ignore-case. 2014-08-12 17:00:18 +02:00
Florian Bruhin
5a88028738 Rename qutebrowser.commands.managers module to .runners. 2014-08-06 15:58:08 +02:00
Florian Bruhin
aebce80b2b Rename {Command,Search}Manager to ...Runner 2014-08-06 15:38:25 +02:00
Florian Bruhin
ee1b136807 Clean up pylint/noqa comments. 2014-08-04 03:47:09 +02:00
Florian Bruhin
7d9bd17aff Fix error message when executing command in wrong mode. 2014-08-02 16:15:59 +02:00
Florian Bruhin
425a7fd7c4 Simplify userscript running. 2014-07-29 02:05:15 +02:00
Florian Bruhin
54246bacbe Add some type checking for enums 2014-07-29 00:23:20 +02:00
Florian Bruhin
54c7f29f04 Remove weird condition when cmd text ends with ' '.
For some reason we checked nargs if split is False. This caused the completion
to not get hidden with ":spawn ". Since this condition makes no sense (and
probably was converted wrong in be467d5e) we remove it here.
2014-07-28 02:27:12 +02:00
Florian Bruhin
e0bd89b762 Add an {url} variable for commands.
Note this also means we don't support :spawn running in a shell anymore, as
{url} is evaluated earlier. However this should be fine, as there's no really
important use case for that anyways, and shell escaping on Windows is rather
unmaintainable.
2014-07-28 01:40:36 +02:00
Florian Bruhin
ca3df5e169 Highlight and select text when searching 2014-06-26 11:10:31 +02:00
Florian Bruhin
4ade32777d Revert "Add search-highlight-all option"
There's a better solution: Calling the function twice, once with highlight,
once with mark.

This reverts commit 8812672d7d.
2014-06-26 10:57:12 +02:00
Florian Bruhin
8812672d7d Add search-highlight-all option 2014-06-26 10:08:26 +02:00
Florian Bruhin
eeef9aa930 Fix inverted ignore-case setting. 2014-06-26 10:04:08 +02:00
Florian Bruhin
92ff957543 Clean up message API 2014-06-26 07:58:00 +02:00
Florian Bruhin
8a8ca0c34f Split utils.misc into utils.{qt,misc} 2014-06-23 07:45:04 +02:00
Florian Bruhin
113221c731 Log some exceptions 2014-06-20 23:26:19 +02:00
Florian Bruhin
d65587128f Add vim modelines to all files. 2014-06-19 09:04:37 +02:00
Florian Bruhin
1fef2d02b9 Add an :all-objects command and __repr__s 2014-06-17 11:03:42 +02:00
Florian Bruhin
af9e4ae072 Fix parent/child relationships 2014-06-17 07:17:21 +02:00
Florian Bruhin
7325cefdae Fix lint 2014-06-16 12:11:10 +02:00
Florian Bruhin
d76226626f Add debug argument for commands 2014-06-16 09:44:11 +02:00
Florian Bruhin
fd220b1b36 Raise CommandError instead of message.error where possible 2014-06-06 11:55:55 +02:00
Florian Bruhin
ec25821fae _foo.py file rename [2/2] 2014-06-03 15:01:57 +02:00
Florian Bruhin
fa1e03f56b _foo.py file rename [1/2] 2014-06-03 14:57:57 +02:00
Florian Bruhin
2eb26c96c4 More command splitting cleanup 2014-06-03 06:55:08 +02:00
Florian Bruhin
1d2d435231 Move split_cmdline() out of commands.managers 2014-06-03 06:55:08 +02:00
Florian Bruhin
fb7f1b381e Fix lint 2014-06-02 18:01:56 +02:00
Florian Bruhin
1e256699f8 Add topic-specific loggers 2014-05-23 16:11:55 +02:00
Florian Bruhin
1d5a1a29e8 Simplify calling commands with an instance.
We used to use a signal and a function in app.py which executes the command
handler. Now we instead use QCoreApplication.instance() which makes everything
a lot easier and cleaner.
2014-05-22 16:14:43 +02:00
Florian Bruhin
0c0cb48471 Fix lint 2014-05-22 15:44:16 +02:00
Florian Bruhin
22072eac7d Cleanup and documentation in commands/userscripts 2014-05-22 04:12:52 +02:00
Florian Bruhin
8d570b686c Initial userscript support 2014-05-21 19:53:58 +02:00
Florian Bruhin
d450257485 Add search-prev and bind N to it 2014-05-19 05:05:54 +02:00
Florian Bruhin
da2dc4861f Rename nextsearch command to search-next 2014-05-19 04:21:30 +02:00
Florian Bruhin
d1f921cc39 Print command name in ArgumentCountException 2014-05-19 04:06:12 +02:00
Florian Bruhin
f0d1d4ed45 Selectively queue messages rather than unqueueing. 2014-05-19 03:40:10 +02:00
Florian Bruhin
d901fe69e6 Rename some commands 2014-05-16 23:01:40 +02:00
Florian Bruhin
326280f910 Fix consistency and spelling in docstrings/comments 2014-05-15 16:27:34 +02:00
Florian Bruhin
603fbdf239 Range-check all values passed to C code. 2014-05-15 00:02:20 +02:00
Florian Bruhin
a045511962 Use exceptions for command errors 2014-05-14 18:00:40 +02:00
Florian Bruhin
df3528e454 Fix lint 2014-05-12 11:22:17 +02:00
Florian Bruhin
5a6208862e Add cmdutils.arg_or_count 2014-05-09 19:12:08 +02:00
Florian Bruhin
edc9d0810c Use QCoreApplication.instance() 2014-05-09 17:01:05 +02:00
Florian Bruhin
c8fd0937b0 Revert "Use global object dict for global objects"
This reverts commit bf2c7831c8.

This was a bad idea as we need to access some of the main attributes
from commands via instance=...
2014-05-05 20:12:20 +02:00
Florian Bruhin
bf2c7831c8 Use global object dict for global objects 2014-05-05 19:12:47 +02:00
Florian Bruhin
667b255d01 Use QApplication for global singletons 2014-05-05 17:56:14 +02:00
Florian Bruhin
45e1feeb27 Handle arguments after aliases correctly when splitting. 2014-05-02 15:24:10 +02:00
Florian Bruhin
1655ddbfac Restore original command when splitting aliases 2014-05-02 15:23:45 +02:00
Florian Bruhin
554d5d2745 Fix command length (s/args/nargs) 2014-05-02 11:28:11 +02:00
Florian Bruhin
be467d5e50 Refactor command argument splitting.
This uses split=True/False as cmdutils.register argument again (because
we would never want to set maxsplit ourselves, only not splitting the
*last* argument makes any sense.

Also this uses shlex for splitting again, like earlier.
2014-05-02 10:28:41 +02:00
Florian Bruhin
0bf918631e Handle maxsplit=-1 correctly for completions 2014-05-01 20:18:29 +02:00
Florian Bruhin
533d82417e Refactor completion handling 2014-05-01 00:23:53 +02:00
Florian Bruhin
4e2517a94f Run sub-commands correctly 2014-04-30 10:47:46 +02:00
Florian Bruhin
995a0d19cc Clean up command exception handling 2014-04-30 10:43:40 +02:00
Florian Bruhin
689723508f Add broken JS checking for commands 2014-04-30 10:05:55 +02:00
Florian Bruhin
bfecafd686 Report if instance in cmdutils.register is missing 2014-04-28 00:01:21 +02:00
Florian Bruhin
8474bbdf6a Rename and reorder config options 2014-04-27 21:21:14 +02:00
Florian Bruhin
6e78f67a81 Rename keyinput stuff 2014-04-25 12:21:01 +02:00
Florian Bruhin
d4b35b6734 Rename {Command,Seach}Parser to *Manager 2014-04-25 12:04:11 +02:00
Florian Bruhin
937196e287 Rename package-private modules to _foo.py 2014-04-25 11:50:30 +02:00
Florian Bruhin
f437bc25bf Fix lint/cleanup 2014-04-25 11:21:00 +02:00
Florian Bruhin
b7440b1f79 Small exception handling cleanup in parsers.py 2014-04-25 11:02:41 +02:00
Florian Bruhin
7787a67c45 Add modes=[]/not_modes=[] to cmdutils.register 2014-04-25 10:10:58 +02:00
Florian Bruhin
c674d96cfe Reorganize input modules into keyinput subpackage 2014-04-24 21:03:45 +02:00
Florian Bruhin
ecdd887664 Split KeyParser into KeyParser (non-chain) and KeyChainParser 2014-04-24 19:21:38 +02:00
Florian Bruhin
718295eb9f Use <> instead of @@ for special keys 2014-04-24 17:48:38 +02:00
Florian Bruhin
8648d88b51 Handle special keys instead of only modifiers 2014-04-24 17:43:19 +02:00
Florian Bruhin
0e3e588038 Add forward_unbound_keys setting 2014-04-24 16:53:16 +02:00
Florian Bruhin
2c5bb6a413 cmdutils.register: Support functions with no docstring 2014-04-23 07:32:00 +02:00
Florian Bruhin
55e3aca702 linting cleanup 2014-04-22 17:53:27 +02:00
Florian Bruhin
7758289f8b Register :nextsearch command. 2014-04-22 15:05:12 +02:00
Florian Bruhin
963066b4bd Remove some old FIXMEs 2014-04-22 14:45:24 +02:00
Florian Bruhin
d7b87e09c9 Implement modes and hint input. 2014-04-21 15:24:19 +02:00
Florian Bruhin
341481cd99 Allow bindings to be modified 2014-04-21 11:00:58 +02:00
Florian Bruhin
52c7376402 Split command-related stuff off from KeyParser 2014-04-21 10:45:57 +02:00
Florian Bruhin
39f580d9f1 Cleanup 2014-04-17 17:44:27 +02:00
Florian Bruhin
457e173592 More config cleanup.
This renames the config instance from "config" to "instance" and adds a
convenience get() function in the config module.
2014-04-17 15:26:27 +02:00
Florian Bruhin
b323706f5f Use maxsplit (passed to str.split()) instead bool 2014-04-17 12:06:27 +02:00
Florian Bruhin
4421862b3e Don't use shlex for splitting anymore 2014-04-17 11:49:19 +02:00
Florian Bruhin
97bde402fb Add docstring 2014-04-17 11:40:19 +02:00
Florian Bruhin
72340575af Remove value from on_config_changed signal again.
Turns out this causes more trouble than it's worth, and it's unintuitive
from which layer we get the value.
2014-04-17 11:39:25 +02:00
Florian Bruhin
7c64e8846a Refresh keybinds when config changes 2014-04-17 11:23:01 +02:00
Florian Bruhin
00dc4d6bc4 Remove set_trace 2014-04-17 11:09:12 +02:00
Florian Bruhin
a1a0325283 Use ChainMap for ValueList config section.
This also fixes the problem where no keybindings are loaded on the first
start.
2014-04-17 11:01:45 +02:00
Florian Bruhin
91e6f4c37d Better linting with config files 2014-04-16 11:05:58 +02:00
Florian Bruhin
e878fc538d Fix some checks 2014-04-16 10:02:34 +02:00
Florian Bruhin
24cdd88415 Fix weird 'no such command' message 2014-04-13 22:56:43 +02:00
Florian Bruhin
175eabdc80 Remove fallback values from config 2014-04-10 14:40:02 +02:00
Florian Bruhin
c5ca0e56be Remove blank lines before """ in docstrings.
pep257 has changed in this regard so we reflect this change.
2014-04-10 14:21:27 +02:00
Florian Bruhin
4ff86b660c Lint fixes 2014-04-10 12:24:41 +02:00
Florian Bruhin
237ff93908 Fix nargs handling 2014-04-10 11:58:05 +02:00
Florian Bruhin
e8f2698877 Improve argument count exception message 2014-04-10 09:56:06 +02:00
Florian Bruhin
6175f5c489 Use ConfigParser-like exceptions for config 2014-04-10 09:52:05 +02:00
Florian Bruhin
2442cf11ab Remove old logging 2014-04-10 09:40:16 +02:00
Florian Bruhin
60cb5ad85d Lint fixes 2014-04-10 07:42:21 +02:00
Florian Bruhin
e9317f807b Accept single int in register decorator for nargs 2014-04-10 07:04:02 +02:00
Florian Bruhin
c26430d08d Remove annoying two-word completions 2014-04-10 06:58:58 +02:00
Florian Bruhin
4c6a41dc94 Actually use nargs= from register_command decorator 2014-04-09 22:43:45 +02:00
Florian Bruhin
68413d8676 Better error for invalid argument count 2014-04-09 22:43:25 +02:00
Florian Bruhin
18bcae40c5 Fix completing when text ends with space #2 2014-04-09 21:15:18 +02:00
Florian Bruhin
72ab405040 Handle statusbar messages centrally 2014-04-09 20:47:24 +02:00
Florian Bruhin
fd3262e2ba Move split_cmdline to commands.parsers 2014-04-09 07:07:32 +02:00
Florian Bruhin
deb286272c Use command parser for completions 2014-04-09 06:58:17 +02:00
Florian Bruhin
1132f7bb6c Lint fixes 2014-03-24 11:48:56 +01:00
Florian Bruhin
fa6f464e23 Refactor completion model changing 2014-03-21 20:01:13 +01:00
Florian Bruhin
ce07baa901 Fix mainname bug 2014-03-10 00:39:15 +01:00
Florian Bruhin
ef8723d246 Remove parsers from cmdutils. 2014-03-10 00:39:15 +01:00
Florian Bruhin
1c43da163e Make this run again 2014-03-10 00:39:15 +01:00
Florian Bruhin
5564e4365e Post-refactor bugfixes 2014-03-10 00:39:14 +01:00
Florian Bruhin
40d7fc6f14 Start refactoring new config to use types 2014-03-10 00:39:14 +01:00
Florian Bruhin
98d15de460 Fix style issues 2014-03-10 00:39:14 +01:00
Florian Bruhin
369ee1f47e Config bugfixes.
Stylesheet still broken, but at least keybindings work.
2014-03-10 00:39:14 +01:00
Florian Bruhin
f079d6bf3b More config update/adoption 2014-03-10 00:39:14 +01:00
Florian Bruhin
4b3ae3f013 Style fixes 2014-03-10 00:39:14 +01:00
Florian Bruhin
265d8b7580 Avoid circular dependencies 2014-03-10 00:39:14 +01:00
Florian Bruhin
b6a28aba7b Add some documentation for decorators 2014-03-10 00:38:48 +01:00
Florian Bruhin
e30774e9d9 Fix variable name 2014-03-03 21:21:07 +01:00
Florian Bruhin
b75fc347dc Fix checks 2014-03-03 21:19:29 +01:00
Florian Bruhin
af0b6901be First kinda working version 2014-03-03 21:06:10 +01:00
Florian Bruhin
97ae3adb4a Working towards using getattr instead 2014-03-03 18:47:42 +01:00
Florian Bruhin
032ccb8b43 Try some broken component register foo 2014-03-03 17:56:53 +01:00
Florian Bruhin
b22b19d881 Start using (broken) decorators 2014-03-03 06:09:23 +01:00
Florian Bruhin
2df9b57981 Continue developing register_command decorator 2014-02-28 17:55:17 +01:00
Florian Bruhin
dcc3993091 Start implementing decorator 2014-02-28 17:00:25 +01:00
Florian Bruhin
d4df78b75f Add settrace command 2014-02-26 22:29:53 +01:00
Florian Bruhin
3b648a4c0d Move config to config subfolder 2014-02-23 18:14:40 +01:00
Florian Bruhin
b8b0d81ab3 Add command aliases 2014-02-21 20:19:01 +01:00
Florian Bruhin
5d32df1d54 Add :version command 2014-02-21 20:00:02 +01:00
Florian Bruhin
cf2133bb96 Add zoomin/zoomout commands. 2014-02-20 19:55:35 +01:00
Florian Bruhin
f70ad71f9c Add error strings to exceptions 2014-02-19 11:11:21 +01:00
Florian Bruhin
93065188a7 All-caps constants 2014-02-19 11:11:19 +01:00
Florian Bruhin
d58ef3ff84 Fix CommandParser.run exit status. 2014-02-19 11:11:18 +01:00
Florian Bruhin
9a990d56d9 Nicer docstrings 2014-02-19 10:58:32 +01:00
Florian Bruhin
5f83228c75 Reorder some methods, widgets not done yet 2014-02-18 17:54:17 +01:00
Florian Bruhin
911d5d3b4a Refactor ALL the things 2014-02-18 16:51:01 +01:00
Florian Bruhin
8fee32e6c4 Support multiple commands 2014-02-18 10:47:01 +01:00
Florian Bruhin
966ceba1e6 Import cleanup 2014-02-17 12:23:52 +01:00
Florian Bruhin
d5807169d1 Decorate slots with pyqtSlot.
This seems to reduce memory usage a bit and make things a bit faster.
2014-02-17 12:00:08 +01:00
Florian Bruhin
933296f47f Move models to qutebrowser.models 2014-02-14 17:41:12 +01:00
Florian Bruhin
203fa3eb34 Docstring grammar fixes 2014-02-13 18:57:19 +01:00
Florian Bruhin
029813c8eb Implement page-wise scrolling. 2014-02-13 10:28:09 +01:00
Florian Bruhin
39ed73c3cf python package cleanup 2014-02-10 15:06:46 +01:00
Florian Bruhin
01633007e0 Be PEP257 compliant. 2014-02-07 20:21:50 +01:00