Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/python/qmk/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from qmk.math_ops import compute
from qmk.util import maybe_exit, truthy

true_values = ['1', 'on', 'yes']
false_values = ['0', 'off', 'no']
TRUE_VALUES = ['true', '1', 'on', 'yes']
FALSE_VALUES = ['false', '0', 'off', 'no']


class LedFlags(IntFlag):
Expand Down Expand Up @@ -319,7 +319,7 @@ def _extract_features(info_data, rules):
for key, value in rules.items():
if key.endswith('_ENABLE'):
key = '_'.join(key.split('_')[:-1]).lower()
value = True if value.lower() in true_values else False if value.lower() in false_values else value
value = True if value.lower() in TRUE_VALUES else False if value.lower() in FALSE_VALUES else value

if key in ['lto']:
continue
Expand Down Expand Up @@ -657,7 +657,7 @@ def _config_to_json(key_type, config_value):
elif key_type in ['bool', 'flag']:
if isinstance(config_value, bool):
return config_value
return config_value in true_values
return config_value in TRUE_VALUES

elif key_type == 'hex':
return '0x' + config_value[2:].upper()
Expand Down