Validate configs properly.

We inherited custom types from String which is wrong and not validated against
ValidValues.
This commit is contained in:
Florian Bruhin 2014-06-19 13:18:25 +02:00
parent 1ab8c3963f
commit b70657eb53

View File

@ -865,14 +865,14 @@ class AutoSearch(BaseType):
return False return False
class Position(String): class Position(BaseType):
"""The position of the tab bar.""" """The position of the tab bar."""
valid_values = ValidValues('north', 'south', 'east', 'west') valid_values = ValidValues('north', 'south', 'east', 'west')
class SelectOnRemove(String): class SelectOnRemove(BaseType):
"""Which tab to select when the focused tab is removed.""" """Which tab to select when the focused tab is removed."""
@ -882,7 +882,7 @@ class SelectOnRemove(String):
('previous', "Select the previously selected tab.")) ('previous', "Select the previously selected tab."))
class LastClose(String): class LastClose(BaseType):
"""Behaviour when the last tab is closed.""" """Behaviour when the last tab is closed."""
@ -891,7 +891,7 @@ class LastClose(String):
('quit', "Quit qutebrowser.")) ('quit', "Quit qutebrowser."))
class AcceptCookies(String): class AcceptCookies(BaseType):
"""Whether to accept a cookie.""" """Whether to accept a cookie."""
@ -899,7 +899,7 @@ class AcceptCookies(String):
('never', "Don't accept cookies at all.")) ('never', "Don't accept cookies at all."))
class WindowOpenBehaviour(String): class WindowOpenBehaviour(BaseType):
"""What to do when a webview requests a new window.""" """What to do when a webview requests a new window."""
@ -908,7 +908,7 @@ class WindowOpenBehaviour(String):
"history will be cleared).")) "history will be cleared)."))
class ConfirmQuit(String): class ConfirmQuit(BaseType):
"""Whether to display a confirmation when the window is closed.""" """Whether to display a confirmation when the window is closed."""
@ -918,7 +918,7 @@ class ConfirmQuit(String):
('never', "Never show a confirmation.")) ('never', "Never show a confirmation."))
class ForwardUnboundKeys(String): class ForwardUnboundKeys(BaseType):
"""Whether to forward unbound keys.""" """Whether to forward unbound keys."""