X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=wizard%2Fbertos_utils.py;h=cbec405d88d86d6d1289cd3dcb99c1a9ba005ccc;hb=7f71ceee79dea7b155679ec439ab6646f2e6bfa6;hp=3854f9f269682ff7c6c02ca0f5f8838b2c9228ff;hpb=ad42262ffafdf46844bfbea6573691d2200600c2;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 3854f9f2..cbec405d 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -247,6 +247,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: @@ -294,38 +299,38 @@ def sub(string, parameter, value): """ return re.sub(r"(?P#define\s+" + parameter + r"\s+)([^\s]+)", r"\g" + value, string) -def isInt(value): +def isInt(informations): """ Return True if the value is a simple int. """ - if "long" not in value["informations"].keys() and "unsigned" not in value["informations"].keys(): + 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(value): +def isLong(informations): """ Return True if the value is a long. """ - if "long" in value["informations"].keys() and value["informations"]["long"] and "unsigned" not in value["informations"].keys(): + if "long" in informations.keys() and informations["long"] and "unsigned" not in informations.keys(): return True else: return False -def isUnsigned(value): +def isUnsigned(informations): """ Return True if the value is an unsigned. """ - if "unsigned" in value["informations"].keys() and value["informations"]["unsigned"] and "long" not in value["informations"].keys(): + if "unsigned" in informations.keys() and informations["unsigned"] and "long" not in informations.keys(): return True else: return False -def isUnsignedLong(value): +def isUnsignedLong(informations): """ Return True if the value is an unsigned long. """ - if "unsigned" in value["informations"].keys() and "long" in value["informations"].keys() and value["informations"]["unsigned"] and value["informations"]["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