(src_path)
| 84 | |
| 85 | |
| 86 | def create_pxd_file_map(src_path): |
| 87 | # Searches through all pxd files and matches them to the corresponding |
| 88 | # OpenMS headers. Note that each header can be mapped to multiple pxd |
| 89 | # files: |
| 90 | # |
| 91 | # pxd_file_matching[ HeaderName ] = set( [PXDFile, PXDFile, ...] ) |
| 92 | # |
| 93 | import glob, os, re |
| 94 | pxd_path = os.path.join(src_path, "src/pyOpenMS/pxds/") |
| 95 | pxds = glob.glob(pxd_path + "/*.pxd") |
| 96 | pxd_file_matching = {} |
| 97 | for pfile in pxds: |
| 98 | filename_rgx = re.compile("cdef extern from \"<([^\"]*)>\"", re.IGNORECASE) |
| 99 | filematch = [o.group(1) for o in filename_rgx.finditer(open(pfile).read()) ] |
| 100 | for fm in filematch: |
| 101 | res = pxd_file_matching.get(fm, set([])) |
| 102 | res.update([pfile]) |
| 103 | pxd_file_matching[fm] = res |
| 104 | |
| 105 | return pxd_file_matching |
| 106 |
no test coverage detected