Florian Bruhin
5eff35ba30
cmdutils.register: annotation -> arg for flags
...
Instead of using a 'flag' key in the annotation dict, we now use a flags
argument to @cmdutils.register which is a {argument: flag} dict.
See #637 .
2016-05-10 07:35:41 +02:00
Florian Bruhin
73fbfb9731
Replace 'nargs' annotation by star_args_optional
...
Before we used a {'nargs': '*'} annotation for the respective argument
to tell qutebrowser it's optional for the commandline. Now we instead
use a star_args_optional argument for @cmdutils.register as a first step
towards freeing up argument annotations for PEP 484.
See #637 .
2016-05-09 22:49:24 +02:00
Florian Bruhin
a5f2ac5f03
Adjust copyright years.
2016-01-04 07:12:39 +01:00
Florian Bruhin
150a83d8f4
pylint: Remove unneeded supressions.
2015-12-01 22:03:58 +01:00
Florian Bruhin
3bfd049a0a
Don't use inspect.getfullargspec().
...
It seems to be deprecated in Python 3.5.
2015-08-16 15:43:28 +02:00
Florian Bruhin
f1ba14b496
Fix exception when using :set.
...
This is a regression introduced in 167faafff2
.
2015-06-13 13:26:29 +02:00
Florian Bruhin
167faafff2
Fix command parsing for arguments containing _.
2015-06-12 11:42:16 +02:00
Florian Bruhin
36803cba06
Switch from flake8 to pytest-{mccabe,flakes,pep8}.
2015-06-02 20:51:06 +02:00
Florian Bruhin
cdde1d7dfc
command: Add support for custom metavar for docs.
2015-05-31 15:10:12 +02:00
Florian Bruhin
b1dd649278
Replace _ by - in command flag names.
...
See #698 .
2015-05-30 19:30:08 +02:00
Florian Bruhin
aaf09dc573
Add possibility to hide command args from docs.
2015-05-15 19:19:30 +02:00
Florian Bruhin
9ee74253e4
Remove name annotation for cmdutils.register.
...
See #637 .
2015-04-20 22:25:27 +02:00
Florian Bruhin
7439586334
Move special params to cmdutils.register decorator
...
See #637 .
2015-04-20 19:33:05 +02:00
Florian Bruhin
0195cb31bb
Don't set scope in cmdutils.register w/o instance.
2015-04-20 18:55:22 +02:00
Florian Bruhin
4e18e54803
Fix handling of flags with args with maxsplit #2 .
...
Fixes #614 .
We only added the long variant of the flag, but not the short one.
2015-04-13 21:12:14 +02:00
Florian Bruhin
501138d5a0
Fix splitting of flags with args with maxsplit.
...
See #614 .
flags_with_args was set on keyword-only arguments, but an argument (like
--force for :bind) can also be keyword-only *and* bool.
2015-04-13 21:07:58 +02:00
Florian Bruhin
b1c475c61d
Use **kwargs to simplify cmdutils.register.
2015-04-06 17:25:42 +02:00
Florian Bruhin
20f0ef7ccc
Ignore ;; for splitting with some commands.
...
Fixes #405 .
2015-04-06 17:00:52 +02:00
Florian Bruhin
8ebac8d38c
Various spelling fixes.
2015-03-31 21:11:47 +02:00
Florian Bruhin
82322beb03
Fix pep257 issues.
2015-03-26 07:08:54 +01:00
Florian Bruhin
7a4a4a4a4e
Pass tab_id correctly with scope='tab' commands.
...
Fixes #563 .
2015-03-19 22:19:25 +01:00
Florian Bruhin
61a52f3b91
command: Check the completion/argument counts.
...
See #531 .
2015-03-05 06:20:55 +01:00
Florian Bruhin
a32f1e6180
Make it possible to deprecate commands.
...
See #448 .
2015-01-15 22:29:00 +01:00
Florian Bruhin
450d1ab70d
Update copyright years
2015-01-03 15:51:31 +01:00
Florian Bruhin
03ac8874ff
Rewrite keymode handling to use only one mode.
...
Fixes #417 .
Fixes #418 .
See 4ab5d2df28
.
2014-12-28 00:01:27 +01:00
Florian Bruhin
451df7bbf4
Handle flags with args correctly with split=False.
2014-12-11 21:17:43 +01:00
Florian Bruhin
b7ea8e7979
Support a maxsplit argument for commands.
2014-12-11 20:32:52 +01:00
Florian Bruhin
0f550f696c
Clean up Command.
2014-10-26 22:08:13 +01:00
Florian Bruhin
0b37ad4348
Don't pass unknown dict keys to argparse in function annotations.
2014-10-20 20:27:33 +02:00
Florian Bruhin
c7f6a747a8
Check flag length in function annotations.
2014-10-20 20:27:19 +02:00
Florian Bruhin
fd6e56d7af
Convert all function annotations to dicts.
2014-10-20 17:20:39 +02:00
Florian Bruhin
bda3c9b1d0
Refactor Command._inspect_function.
2014-10-14 07:59:42 +02:00
Florian Bruhin
1761d98c1b
Fix lint
2014-10-10 07:50:50 +02:00
Florian Bruhin
0e771db7f1
Use annotation instead of special argument names.
...
Explicit is better than implicit.
Fixes #161 .
2014-10-09 06:33:24 +02:00
Florian Bruhin
33043f0f6c
Fix lint
2014-10-08 22:20:38 +02:00
Florian Bruhin
d32a0c30c6
command: Remove unneeded has_count check.
2014-10-08 07:40:53 +02:00
Florian Bruhin
1a00d6168c
command: Check for handlers with count and no default.
2014-10-08 07:40:39 +02:00
Florian Bruhin
6349a6a213
Remove Emit:/Raise: from docstrings.
...
They got out-of-sync fast and provided no real benefit.
2014-10-07 23:08:37 +02:00
Florian Bruhin
9281fa3992
Fix lint/bugs
2014-10-06 19:53:50 +02:00
Florian Bruhin
714c9d8b01
Add win_id parameter to commands which need it.
2014-09-29 19:14:11 +02:00
Florian Bruhin
fb6cb62f93
First attempt at multi-window support.
2014-09-28 22:13:14 +02:00
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
e527db1560
Add scope argument to cmdutils.register/commands.
2014-09-25 07:41:51 +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
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
4d3b3616a6
Fix lint
2014-09-14 23:56:19 +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
d4f584684b
command: Iterate over function signature when calling instead over namespace.
2014-09-14 22:48:25 +02:00
Florian Bruhin
381b06e967
Fix lint
2014-09-08 07:44:32 +02:00
Florian Bruhin
dcfb52847f
Nicer flag output in docs.
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
c72bfff306
Rename commands.exceptions to commands.cmdexc.
2014-08-26 20:38:10 +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
7d9bd17aff
Fix error message when executing command in wrong mode.
2014-08-02 16:15:59 +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
d65587128f
Add vim modelines to all files.
2014-06-19 09:04:37 +02:00
Florian Bruhin
af9e4ae072
Fix parent/child relationships
2014-06-17 07:17:21 +02:00
Florian Bruhin
d76226626f
Add debug argument for commands
2014-06-16 09:44:11 +02:00
Florian Bruhin
ec25821fae
_foo.py file rename [2/2]
2014-06-03 15:01:57 +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
7787a67c45
Add modes=[]/not_modes=[] to cmdutils.register
2014-04-25 10:10:58 +02:00
Florian Bruhin
963066b4bd
Remove some old FIXMEs
2014-04-22 14:45:24 +02:00
Florian Bruhin
39f580d9f1
Cleanup
2014-04-17 17:44:27 +02:00
Florian Bruhin
b323706f5f
Use maxsplit (passed to str.split()) instead bool
2014-04-17 12:06:27 +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
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
68413d8676
Better error for invalid argument count
2014-04-09 22:43:25 +02:00
Florian Bruhin
fa6f464e23
Refactor completion model changing
2014-03-21 20:01:13 +01:00
Florian Bruhin
b6a28aba7b
Add some documentation for decorators
2014-03-10 00:38:48 +01:00
Florian Bruhin
af0b6901be
First kinda working version
2014-03-03 21:06:10 +01:00