diff --git a/meshroom/core/desc.py b/meshroom/core/desc.py index f74b7a03181..38f79576913 100755 --- a/meshroom/core/desc.py +++ b/meshroom/core/desc.py @@ -5,6 +5,8 @@ import os import psutil import ast +import distutils + class Attribute(BaseObject): """ @@ -191,7 +193,8 @@ def __init__(self, name, label, description, value, uid, group='allParams', adva def validateValue(self, value): try: - return bool(int(value)) # int cast is useful to handle string values ('0', '1') + # use distutils.util.strtobool to handle (1/0, true/false, on/off, y/n) + return bool(distutils.util.strtobool(value)) except: raise ValueError('BoolParam only supports bool value (param:{}, value:{}, type:{})'.format(self.name, value, type(value)))