mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 10:34:19 +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):
|
||||
s = s.strip().lower()
|
||||
if s in ('true', 'on', 'enable', 'enabled'):
|
||||
if s in ('true', 'on', 'enable', 'enabled', '1'):
|
||||
return True
|
||||
elif s in ('false', 'off', 'disable', 'disabled'):
|
||||
elif s in ('false', 'off', 'disable', 'disabled', '0'):
|
||||
return False
|
||||
else:
|
||||
raise ValueError, 'Invalid string for toBool: %s' % quoted(s)
|
||||
|
Loading…
Reference in New Issue
Block a user