From c0b47b9b31223e15e4edc69ac66cafe572f3b0dd Mon Sep 17 00:00:00 2001 From: duplo Date: Thu, 5 Feb 2009 09:44:56 +0000 Subject: [PATCH] Add support for Unsigned int git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2263 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BModulePage.py | 12 +++++++++--- wizard/bertos_utils.py | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index deed395e..71a2f2e6 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -112,9 +112,15 @@ class BModulePage(BWizardPage): else: maximum = 32767 spinBox.setMaximum(maximum) - if "long" in configurations[property]["informations"].keys() and configurations[property]["informations"]["long"] == "True": - spinBox.setSuffix("L") - spinBox.setValue(int(configurations[property]["value"].replace("L", ""))) + if "unsigned" in configurations[property]["informations"].keys() and configurations[property]["informations"]["unsigned"]: + suff = str(spinBox.suffix()) + suff += "U" + spinBox.setSuffix(suff) + if "long" in configurations[property]["informations"].keys() and configurations[property]["informations"]["long"]: + suff = str(spinBox.suffix()) + suff += "L" + spinBox.setSuffix(suff) + spinBox.setValue(int(configurations[property]["value"].replace("L", "").replace("U", ""))) self._controlGroup.addControl(index, spinBox) def _currentModule(self): diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index d405130f..5436a3b3 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -55,6 +55,8 @@ def createBertosProject(projectInfos): string = open(sourcesDir + "/" + key, "r").read() for parameter, infos in value.items(): value = infos["value"] + if "unsigned" in infos["informations"].keys() and infos["informations"]["unsigned"]: + value += "U" if "long" in infos["informations"].keys() and infos["informations"]["long"]: value += "L" string = sub(string, parameter, value) -- 2.25.1