diff options
author | Nicholas Schwab <git@nicholas-schwab.de> | 2021-04-08 16:27:08 +0200 |
---|---|---|
committer | Nicholas Schwab <git@nicholas-schwab.de> | 2021-04-08 16:27:08 +0200 |
commit | aa1c2b6ac2a0d715ac9b413eb469d4a6a698039e (patch) | |
tree | a6a015499ea622673809fd13f34c8f693af2a05d | |
parent | 525548a2024e1befada8cc939c66c72f00234d76 (diff) | |
download | qutebrowser-aa1c2b6ac2a0d715ac9b413eb469d4a6a698039e.tar.gz qutebrowser-aa1c2b6ac2a0d715ac9b413eb469d4a6a698039e.zip |
Reworked StatusbarWidget to use ValidPrefixes.
-rw-r--r-- | qutebrowser/config/configtypes.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 55676207f..0e69be684 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -2025,7 +2025,11 @@ class StatusbarWidget(String): Allows some predefined widgets and custom text-widgets via text:$CONTENT.""" + def __init__(self, *, valid_prefixes: ValidPrefixes = None, **kwargs): + super().__init__(**kwargs) + self.valid_prefixes = valid_prefixes + def _validate_valid_values(self, value: str) -> None: - if value.startswith("text:"): + if value in self.valid_prefixes: return super()._validate_valid_values(value) |