From 72d4421ac8a459da771cc1e5aa90271742583307 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 15 Jun 2017 19:18:32 +0200 Subject: [PATCH] Make ShellCommand a List subclass Also, let's not require a list in Command (which is used for aliases). --- qutebrowser/config/configtypes.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index eb4848fb4..80c7aed55 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -724,7 +724,6 @@ class Command(BaseType): """Base class for a command value with arguments.""" def to_py(self, value): - # FIXME:conf require a list here? self._basic_py_validation(value, str) if not value: return @@ -1106,7 +1105,7 @@ class FormatString(BaseType): return value -class ShellCommand(BaseType): +class ShellCommand(List): """A shellcommand which is split via shlex. @@ -1115,7 +1114,7 @@ class ShellCommand(BaseType): """ def __init__(self, placeholder=False, none_ok=False): - super().__init__(none_ok) + super().__init__(valtype=String(), none_ok=none_ok) self.placeholder = placeholder def from_str(self, value): @@ -1131,8 +1130,7 @@ class ShellCommand(BaseType): return split_val def to_py(self, value): - # FIXME:conf require a str/list here? - self._basic_py_validation(value, list) + value = super().to_py(value) if not value: return None @@ -1141,11 +1139,6 @@ class ShellCommand(BaseType): "{}-placeholder.") return value - def to_str(self, value): - if not value: - return '' - return json.dumps(value) - class Proxy(BaseType):