Build a dict that maps paths to groups
(path)
| 47 | |
| 48 | |
| 49 | def FindGroups(path): |
| 50 | """Build a dict that maps paths to groups""" |
| 51 | |
| 52 | pathToGroups = dict() |
| 53 | fileProg = re.compile(r"itk-module.cmake") |
| 54 | moduleProg = re.compile(".*itk_module[^(]*\(([^ \n]*)", re.S) |
| 55 | for root, dirs, files in os.walk(path): |
| 56 | for f in files: |
| 57 | if fileProg.match(f): |
| 58 | fid = open(root + "/" + f, "r") |
| 59 | contents = fid.read() |
| 60 | m = moduleProg.match(contents) |
| 61 | if m: |
| 62 | groupName = os.path.basename(root) |
| 63 | parts = root.split("/") |
| 64 | pathToGroups[parts[len(parts) - 2] + parts[len(parts) - 1]] = ( |
| 65 | groupName |
| 66 | ) |
| 67 | fid.close() |
| 68 | return pathToGroups |
| 69 | |
| 70 | |
| 71 | pathToITK = "/home/blowekamp/src/ITK" |
no outgoing calls
no test coverage detected