mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
22 lines
376 B
Python
22 lines
376 B
Python
_MAP = {
|
|
'y': True,
|
|
'yes': True,
|
|
't': True,
|
|
'true': True,
|
|
'on': True,
|
|
'1': True,
|
|
'n': False,
|
|
'no': False,
|
|
'f': False,
|
|
'false': False,
|
|
'off': False,
|
|
'0': False
|
|
}
|
|
|
|
|
|
def strtobool(value):
|
|
try:
|
|
return _MAP[str(value).lower()]
|
|
except KeyError:
|
|
raise ValueError('"{}" is not a valid bool value'.format(value))
|