diff --git a/pytomoatt/_version.py b/pytomoatt/_version.py index 0b1bdb2..a53c568 100644 --- a/pytomoatt/_version.py +++ b/pytomoatt/_version.py @@ -1 +1 @@ -__version__ = '0.2.12' \ No newline at end of file +__version__ = '0.2.13' diff --git a/pytomoatt/utils/common.py b/pytomoatt/utils/common.py index 5f7699a..cede4c2 100644 --- a/pytomoatt/utils/common.py +++ b/pytomoatt/utils/common.py @@ -199,6 +199,17 @@ def str2val(str_val): except ValueError: pass + if str_val.lower() in ['true', 'false', 'yes', 'no']: + return str_val.lower() in ['true', 'yes'] + + # return list of boolean + try: + items = [v.strip() for v in str_val.strip('[]').split(',')] + if all(v.lower() in ['true', 'false', 'yes', 'no'] for v in items): + return [v.lower() in ['true', 'yes'] for v in items] + except Exception: + pass + return str_val