From 54e2ba4de2c89b737ea8710d65752f33c512ca39 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 25 Feb 2014 22:24:53 +0100 Subject: [PATCH] Add some new value types --- qutebrowser/config/options.py | 42 ++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/qutebrowser/config/options.py b/qutebrowser/config/options.py index e9f51121c..895a1e757 100644 --- a/qutebrowser/config/options.py +++ b/qutebrowser/config/options.py @@ -160,16 +160,6 @@ class LastClose(template.SettingValue): ("quit", "Quit qutebrowser.")] default = "ignore" -### FIXME what to do with list-style sections? - - -class SearchEngine(template.SettingValue): - - """A search engine setting.""" - - def validate(self): - return "{}" in self.value - class CompletionFgColor(template.ColorSettingValue): @@ -373,3 +363,35 @@ class StatusbarFont(template.FontSettingValue): default = MonospaceFonts.default default_conf = "8pt ${_monospace}" + + +class SearchEngineName(template.SettingValue): + + """A search engine name.""" + + def validate(self): + return True + + +class SearchEngineUrl(template.SettingValue): + + """A search engine URL.""" + + def validate(self): + return "{}" in self.value + + +class KeyBindingName(template.SettingValue): + + """The name (keys) of a keybinding.""" + + def validate(self): + # FIXME can we validate anything here? + return True + + +class KeyBinding(template.CommandSettingValue): + + """The command of a keybinding.""" + + pass