Commit Graph

320 Commits

Author SHA1 Message Date
Florian Bruhin
65d1d21d2e Always use a list for namedtuple. 2014-09-28 00:43:08 +02:00
Florian Bruhin
0fadf6b091 Use a list as items-argument for usertypes.enum 2014-09-28 00:42:53 +02:00
Florian Bruhin
36fd2e5c7f Improve __repr__ methods. 2014-09-26 15:48:24 +02:00
Florian Bruhin
e527db1560 Add scope argument to cmdutils.register/commands. 2014-09-25 07:41:51 +02:00
Florian Bruhin
05ff908c4f Update attributes in docstrings. 2014-09-24 22:25:11 +02:00
Florian Bruhin
62e55499eb Privatize all attributes which aren't needed from the outside. 2014-09-24 22:25:11 +02:00
Florian Bruhin
3f02451828 Move object registry to its own file. 2014-09-24 07:06:45 +02:00
Florian Bruhin
2b60cdb64c Object names cleanup 2014-09-23 23:05:55 +02:00
Florian Bruhin
297e37fdf2 Remove legacy instance= parameter support. 2014-09-23 22:08:05 +02:00
Florian Bruhin
a76c4c8ba5 Use object registry for tabbedbrowser. 2014-09-23 22:01:46 +02:00
Florian Bruhin
5f45d3de60 Use object registry for modeman. 2014-09-23 20:02:48 +02:00
Florian Bruhin
ab95234dad Add object registry support to command handler. 2014-09-23 19:53:48 +02:00
Florian Bruhin
f4876c7f4f Split docutils from utils 2014-09-23 04:22:51 +02:00
Florian Bruhin
9954a08ea2 Fix commands with ignore_args=True (e.g. :restart) 2014-09-22 22:46:03 +02:00
Florian Bruhin
34b0cf429c command: Cleanup 2014-09-15 08:16:19 +02:00
Florian Bruhin
8a51aa759e command: Clean up ParamType. 2014-09-15 07:46:50 +02:00
Florian Bruhin
e1d93fa3fa Move inspect stuff from cmdutils to command. 2014-09-15 07:42:21 +02:00
Florian Bruhin
22e6a26ec3 Fix function calls with changed attribute names. 2014-09-15 06:20:33 +02:00
Florian Bruhin
f2e68685d2 Fix doc generation with overridden argument names. 2014-09-15 00:03:39 +02:00
Florian Bruhin
4d3b3616a6 Fix lint 2014-09-14 23:56:19 +02:00
Florian Bruhin
063be350e4 cmdutils: Merge _param_to_argparse_args and _param_to_argparse_kw. 2014-09-14 23:34:55 +02:00
Florian Bruhin
66f0aa8d5f cmdutils: Bind keyword-only arguments as flags. 2014-09-14 23:25:40 +02:00
Florian Bruhin
fe08052641 command: Don't handle varargs if they are None 2014-09-14 23:16:54 +02:00
Florian Bruhin
f1f05516b3 command: Fix handling of count when it's not given. 2014-09-14 23:06:52 +02:00
Florian Bruhin
b2058e2f0e cmdutils: Default to nargs='+' for *args. 2014-09-14 22:56:02 +02:00
Florian Bruhin
d4f584684b command: Iterate over function signature when calling instead over namespace. 2014-09-14 22:48:25 +02:00
Florian Bruhin
4b759c5513 cmdutils: Make sure functions don't have **kwargs. 2014-09-14 22:48:00 +02:00
Florian Bruhin
cd8d137dd6 cmdutils: Bail out if instance is given but function takes no self. 2014-09-14 22:47:18 +02:00
Florian Bruhin
319ea242da cmdutils: raise TypeError instead of ValueError. 2014-09-14 22:46:48 +02:00
Florian Bruhin
ef31157f5e cmdutils: Use inspect.getdoc 2014-09-14 22:09:01 +02:00
Florian Bruhin
80ef0782d5 Improve some docstrings. 2014-09-13 00:22:27 +02:00
Florian Bruhin
381b06e967 Fix lint 2014-09-08 07:44:32 +02:00
Florian Bruhin
0267dac2be Add --help documentation 2014-09-08 07:36:18 +02:00
Florian Bruhin
fc70d700b2 cmdutils: Force metavar if choices are given. 2014-09-08 07:36:17 +02:00
Florian Bruhin
dcfb52847f Nicer flag output in docs. 2014-09-08 07:36:17 +02:00
Florian Bruhin
6674eedfae cmdutils: Add default value type to multitype_conv tuple. 2014-09-08 07:36:17 +02:00
Florian Bruhin
13a2506c6a argparser: Also catch TypeError for multitype_conv. 2014-09-08 07:36:17 +02:00
Florian Bruhin
47f42f9e5a commands.argparser: Make type tuples a set(). 2014-09-08 07:36:17 +02:00
Florian Bruhin
05f3809d01 Fix lint 2014-09-08 07:36:17 +02:00
Florian Bruhin
b453ae563e Clean up docstring parsing and move it into qutebrowser for commands. 2014-09-08 07:36:17 +02:00
Florian Bruhin
b5f28b6ff2 commands.argparser: Make ArgumentParser take args, add name. 2014-09-08 07:36:17 +02:00
Florian Bruhin
a656c8cfb0 commands: Add initial --help argument support. 2014-09-08 07:36:17 +02:00
Florian Bruhin
32e24479b9 commands.cmdutils: Clean up decorator. 2014-09-08 07:36:17 +02:00
Florian Bruhin
03a0a1c599 commands: Handle ArgumentParser exit. 2014-09-08 07:36:17 +02:00
Florian Bruhin
57d51ad9bb Lots of fixes for new command system.
Squashed commit:

- Fix getting current URL
- Get rid of *args for hints.
- Make enums work.
- Fix moving commands to utilcmds.
- Fix enums in argparse
- Fix arg splitting for hints.
- Fix default enum args.
- Fix argument splitting for hints if None is given.
- Fix set_cmd_text with flags and fix {url}.
- Fix unittests
- Fix tuple types for arguments.
- Fix scroll-page.
- Fix lint
- Fix open_target.
- Others
2014-09-08 07:36:17 +02:00
Florian Bruhin
d836e26107 Nicer debug printing of functions. 2014-09-08 07:36:17 +02:00
Florian Bruhin
a811f8cb07 Start initial newcmd stuff. 2014-09-08 07:36:17 +02:00
Florian Bruhin
ccfc0b3c19 Get rid of most @property's.
They were problematic because they're executing hidden code, and also PyQt
hides exceptions happening inside them.
2014-09-02 23:37:47 +02:00
Florian Bruhin
ce4a5affa4 Rename commands.utils to commands.cmdutils. 2014-08-26 20:48:39 +02:00
Florian Bruhin
c72bfff306 Rename commands.exceptions to commands.cmdexc. 2014-08-26 20:38:10 +02:00
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