mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 18:44:04 +01:00
Allow 1/0 for booleans.
This commit is contained in:
parent
49f8105263
commit
df0b661d92
@ -825,9 +825,9 @@ def callTracer(fd=None, basename=True):
|
|||||||
|
|
||||||
def toBool(s):
|
def toBool(s):
|
||||||
s = s.strip().lower()
|
s = s.strip().lower()
|
||||||
if s in ('true', 'on', 'enable', 'enabled'):
|
if s in ('true', 'on', 'enable', 'enabled', '1'):
|
||||||
return True
|
return True
|
||||||
elif s in ('false', 'off', 'disable', 'disabled'):
|
elif s in ('false', 'off', 'disable', 'disabled', '0'):
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
raise ValueError, 'Invalid string for toBool: %s' % quoted(s)
|
raise ValueError, 'Invalid string for toBool: %s' % quoted(s)
|
||||||
|
Loading…
Reference in New Issue
Block a user