X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos_utils.py;h=925774ba387fefe0761b66364763fb40c9a8bc9d;hb=9d4807e10b3ffccbee160aab1b67b13779cf6766;hp=5436a3b3bd5afb53e9bc88ac61ef1d791f6ec575;hpb=c0b47b9b31223e15e4edc69ac66cafe572f3b0dd;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 5436a3b3..925774ba 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -212,6 +212,16 @@ def loadConfigurationInfos(path): configurationInfos[name] = {} configurationInfos[name]["value"] = value configurationInfos[name]["informations"] = informations + if ("type" in configurationInfos[name]["informations"].keys() and + configurationInfos[name]["informations"]["type"] == "int" and + configurationInfos[name]["value"].find("L") != -1): + configurationInfos[name]["informations"]["long"] = True + configurationInfos[name]["value"] = configurationInfos[name]["value"].replace("L", "") + if ("type" in configurationInfos[name]["informations"].keys() and + configurationInfos[name]["informations"]["type"] == "int" and + configurationInfos[name]["value"].find("U") != -1): + configurationInfos[name]["informations"]["unsigned"] = True + configurationInfos[name]["value"] = configurationInfos[name]["value"].replace("U", "") configurationInfos[name]["description"] = description return configurationInfos except SyntaxError: @@ -241,6 +251,11 @@ def loadModuleInfos(path): "configuration": WIZARD_MODULE["configuration"], "description": "", "enabled": False} + index = comment.find("\\brief") + if index != -1: + description = comment[index + 7:] + description = description[:description.find(" * ")] + moduleInfos[WIZARD_MODULE["name"]]["description"] = description return moduleInfos return {} except SyntaxError: @@ -287,3 +302,39 @@ def sub(string, parameter, value): Substitute the given value at the given parameter define in the given string """ return re.sub(r"(?P#define\s+" + parameter + r"\s+)([^\s]+)", r"\g" + value, string) + +def isInt(informations): + """ + Return True if the value is a simple int. + """ + if ("long" not in informatios.keys() or not informations["long"]) and ("unsigned" not in informations.keys() or informations["unsigned"]): + return True + else: + return False + +def isLong(informations): + """ + Return True if the value is a long. + """ + if "long" in informations.keys() and informations["long"] and "unsigned" not in informations.keys(): + return True + else: + return False + +def isUnsigned(informations): + """ + Return True if the value is an unsigned. + """ + if "unsigned" in informations.keys() and informations["unsigned"] and "long" not in informations.keys(): + return True + else: + return False + +def isUnsignedLong(informations): + """ + Return True if the value is an unsigned long. + """ + if "unsigned" in informations.keys() and "long" in informations.keys() and informations["unsigned"] and informations["long"]: + return True + else: + return False \ No newline at end of file