diff --git a/qutebrowser/config/conftypes.py b/qutebrowser/config/conftypes.py index c8edfc5a4..c7589659f 100644 --- a/qutebrowser/config/conftypes.py +++ b/qutebrowser/config/conftypes.py @@ -164,6 +164,22 @@ class Int(BaseType): raise ValidationError(value, "must be an integer!") +class Float(BaseType): + + """Base class for an float setting.""" + + typestr = 'float' + + def transform(self, value): + return float(value) + + def validate(self, value): + try: + float(value) + except ValueError: + raise ValidationError(value, "must be a float!") + + class List(BaseType): """Base class for a (string-)list setting."""