MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / create_pxd_file_map

Function create_pxd_file_map

tools/PythonCheckerLib.py:86–105  ·  view source on GitHub ↗
(src_path)

Source from the content-addressed store, hash-verified

84
85
86def 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

Callers 1

checkPythonPxdHeaderFunction · 0.90

Calls 4

groupMethod · 0.45
readMethod · 0.45
getMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected