Allow to have boolean as states value

This commit is contained in:
Cédric Krier committed 2010-03-17 17:54:16 +01:00
1 parent dee1f99c73
commit 84b0c7ebbf
1 file changed
+4 -3
+4 -3
View File
@@ -28,10 +28,11 @@ def states_validate(value):
for state in value:
if state == 'icon':
continue
assert isinstance(value[state], PYSON), \
assert isinstance(value[state], (bool, PYSON)), \
'values of states must be PYSON'
assert value[state].types() == set([bool]), \
'values of states must return boolean'
if hasattr(value[state], 'types'):
assert value[state].types() == set([bool]), \
'values of states must return boolean'
def on_change_validate(value):
if value: