From 642abac634fe6f8bdb01a1c1871c300bf915a1e7 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 27 Jul 2016 13:06:15 -0400 Subject: [PATCH] Remove BaseList type --- qutebrowser/config/configdata.py | 7 ++++--- qutebrowser/config/configtypes.py | 24 ++++++++---------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 16b76a681..1319f1948 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -135,7 +135,8 @@ def data(readonly=False): "Whether to find text on a page case-insensitively."), ('startpage', - SettingValue(typ.BaseList(), 'https://duckduckgo.com'), + SettingValue(typ.List(typ.Url(), none_ok=True), + 'https://duckduckgo.com'), "The default page(s) to open at the start, separated by commas."), ('default-page', @@ -352,7 +353,7 @@ def data(readonly=False): "(requires restart)"), ('keyhint-blacklist', - SettingValue(typ.BaseList(none_ok=True), ''), + SettingValue(typ.List(typ.String(), none_ok=True), ''), "Keychains that shouldn't be shown in the keyhint dialog\n\n" "Globs are supported, so ';*' will blacklist all keychains" "starting with ';'. Use '*' to disable keyhints"), @@ -845,7 +846,7 @@ def data(readonly=False): "Whether host blocking is enabled."), ('host-blocking-whitelist', - SettingValue(typ.BaseList(none_ok=True), 'piwik.org'), + SettingValue(typ.List(typ.String(), none_ok=True), 'piwik.org'), "List of domains that should always be loaded, despite being " "ad-blocked.\n\n" "Domains may contain * and ? wildcards and are otherwise " diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 4907d9f2f..88e1a88b1 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -327,9 +327,15 @@ class List(BaseType): self.inner_type.validate(val.strip()) -class BaseList(List): +class FlagList(List): - """Base class for a list using BaseType.""" + """Base class for a list setting that contains one or more flags. + + Lists with duplicate flags are invalid and each item is checked against + self.valid_values (if not empty). + """ + + combinable_values = None def __init__(self, none_ok=False, valid_values=None): super().__init__(BaseType(), none_ok) @@ -340,20 +346,6 @@ class BaseList(List): super().validate(value) else: self._basic_validation(value) - - -class FlagList(BaseList): - - """Base class for a list setting that contains one or more flags. - - Lists with duplicate flags are invalid and each item is checked against - self.valid_values (if not empty). - """ - - combinable_values = None - - def validate(self, value): - super().validate(value) if not value: return vals = super().transform(value)