From 50f6a053718d917970b9ff56f81056761254ffd4 Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 16 Jan 2009 15:38:50 +0000 Subject: [PATCH] Add a header parse function stub git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2177 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos_utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 8f91878d..fc225d0a 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -93,3 +93,11 @@ def getInfos(definition): D["DEFINITION_PATH"] = definition[1] + "/" + definition[0] del D["include"] return D + +def getDefinitionBlocks(text): + block = [] + block_tmp = re.findall("^/\*+\s*(.*?)\s*?\*/\s*#define\s+(\w+[\s\w]*?)\s*$", text, re.DOTALL | re.MULTILINE) + for comment, define in block_tmp: + block.append((" ".join(re.findall("^\s*\*?\s*(.*?)\s*?$", comment, re.MULTILINE)), define)) + block += re.findall("/{3}