summaryrefslogtreecommitdiff
path: root/qutebrowser/commands
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-01-27 15:08:41 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-01-27 15:08:41 +0100
commitac2576c61da6ac320bd85d2850f96d2cc59409b2 (patch)
treedf65c2f3c8998caa1424645274c77c45c326997c /qutebrowser/commands
parent4b8c9336a3cdb5f6ba8c175d724c4bde1ee5b08a (diff)
downloadqutebrowser-ac2576c61da6ac320bd85d2850f96d2cc59409b2.tar.gz
qutebrowser-ac2576c61da6ac320bd85d2850f96d2cc59409b2.zip
command: Improve deprecation
Add a test and also allow setting a deprecated alias for a command easily.
Diffstat (limited to 'qutebrowser/commands')
-rw-r--r--qutebrowser/commands/command.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/qutebrowser/commands/command.py b/qutebrowser/commands/command.py
index 5ec14b557..653f551ff 100644
--- a/qutebrowser/commands/command.py
+++ b/qutebrowser/commands/command.py
@@ -128,10 +128,7 @@ class Command:
self._signature = inspect.signature(handler)
self._type_hints = typing.get_type_hints(handler)
- # This is checked by future @cmdutils.argument calls so they fail
- # (as they'd be silently ignored otherwise)
self._qute_args = getattr(self.handler, 'qute_args', {})
- self.handler.qute_args = None
self._check_func()
self._inspect_func()
@@ -152,8 +149,7 @@ class Command:
"backend.".format(self.name, self.backend.name))
if self.deprecated:
- message.warning('{} is deprecated - {}'.format(self.name,
- self.deprecated))
+ message.warning(f'{self.name} is deprecated - {self.deprecated}')
def _check_func(self):
"""Make sure the function parameters don't violate any rules."""