summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-09-25 13:43:07 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2017-09-25 13:43:07 +0200
commit7d86ff311949db5fc8a6d3791bb9c763627fb587 (patch)
treef456a81b2c19788f08989a71e99c4814494c26b3 /kconfiglib.py
parent55f00fdd55ec20ea5597b8144f4ea3e59a33efe0 (diff)
Get rid of _BOOL_STR
The default string conversions for bools is fine. Turns "true"/"false" into "True"/"False" in object string representations. Hopefully that's not too bad of a backwards-compatibiltiy break.
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index a4bfbb1..0aadf2f 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -607,9 +607,9 @@ class Config(object):
if self._config_filename is None
else self._config_filename),
"Print warnings : " +
- _BOOL_STR[self._print_warnings],
+ str(self._print_warnings),
"Print assignments to undefined symbols : " +
- _BOOL_STR[self._print_undef_assign])
+ str(self._print_undef_assign))
#
# Private methods
@@ -1786,10 +1786,10 @@ class Config(object):
"Value : " + s(sc.get_value()),
"User value : " + user_val_str,
"Visibility : " + s(_get_visibility(sc)),
- "Is choice item : " + _BOOL_STR[sc._is_choice_sym],
- "Is defined : " + _BOOL_STR[sc._is_defined],
- "Is from env. : " + _BOOL_STR[sc._is_from_env],
- "Is special : " + _BOOL_STR[sc._is_special],
+ "Is choice item : " + str(sc._is_choice_sym),
+ "Is defined : " + str(sc._is_defined),
+ "Is from env. : " + str(sc._is_from_env),
+ "Is special : " + str(sc._is_special),
"")
if sc._ranges:
res += _lines("Ranges:", ranges_str + "\n")
@@ -1849,7 +1849,7 @@ class Config(object):
"User value : " + user_val_str,
"Mode : " + s(sc.get_mode()),
"Visibility : " + s(_get_visibility(sc)),
- "Optional : " + _BOOL_STR[sc._optional],
+ "Optional : " + str(sc._optional),
"Prompts:",
prompts_str,
"Defaults:",
@@ -3573,12 +3573,6 @@ _get_keyword = {
"visible": _T_VISIBLE,
}.get
-# Strings to use for True and False
-_BOOL_STR = {
- False: "false",
- True: "true",
-}
-
# Tokens after which identifier-like lexemes are treated as strings. _T_CHOICE
# is included to avoid symbols being registered for named choices.
_STRING_LEX = frozenset((