summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2015-06-12 02:14:45 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2015-06-12 04:10:13 +0200
commitbac624610819ad547d47bbe9e7510aa653dcee15 (patch)
tree45f06be23e4c27d0c88345198389ad5cfd1be846
parent76f495a796fdc6663d2631df7f28c9edeea736fc (diff)
Rearrange Symbol._make_conf() cases.
"y" is more common than "m", and INT and HEX are slightly more common than STRING.
-rw-r--r--kconfiglib.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index f259b0a..dcda3e7 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -2516,19 +2516,19 @@ class Symbol(Item):
return []
if self.type == BOOL or self.type == TRISTATE:
- if val == "m" or val == "y":
+ if val == "y" or val == "m":
return ["CONFIG_{0}={1}".format(self.name, val)]
return ["# CONFIG_{0} is not set".format(self.name)]
+ elif self.type == INT or self.type == HEX:
+ return ["CONFIG_{0}={1}".format(self.name, val)]
+
elif self.type == STRING:
# Escape \ and "
return ['CONFIG_{0}="{1}"'
.format(self.name,
val.replace("\\", "\\\\").replace('"', '\\"'))]
- elif self.type == INT or self.type == HEX:
- return ["CONFIG_{0}={1}".format(self.name, val)]
-
else:
_internal_error("Internal error while creating .config: unknown "
'type "{0}".'.format(self.type))