From bac624610819ad547d47bbe9e7510aa653dcee15 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 12 Jun 2015 02:14:45 +0200 Subject: Rearrange Symbol._make_conf() cases. "y" is more common than "m", and INT and HEX are slightly more common than STRING. --- kconfiglib.py | 8 ++++---- 1 file 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)) -- cgit v1.2.3