MCPcopy Create free account
hub / github.com/numpy/numpy / parse_nm

Function parse_nm

numpy/distutils/lib2def.py:74–94  ·  view source on GitHub ↗

Returns a tuple of lists: dlist for the list of data symbols and flist for the list of function symbols. dlist, flist = parse_nm(nm_output)

(nm_output)

Source from the content-addressed store, hash-verified

72 return nm_output
73
74def parse_nm(nm_output):
75 """Returns a tuple of lists: dlist for the list of data
76symbols and flist for the list of function symbols.
77
78dlist, flist = parse_nm(nm_output)"""
79 data = DATA_RE.findall(nm_output)
80 func = FUNC_RE.findall(nm_output)
81
82 flist = []
83 for sym in data:
84 if sym in func and (sym[:2] == 'Py' or sym[:3] == '_Py' or sym[:4] == 'init'):
85 flist.append(sym)
86
87 dlist = []
88 for sym in data:
89 if sym not in flist and (sym[:2] == 'Py' or sym[:3] == '_Py'):
90 dlist.append(sym)
91
92 dlist.sort()
93 flist.sort()
94 return dlist, flist
95
96def output_def(dlist, flist, header, file = sys.stdout):
97 """Outputs the final DEF file to a file defaulting to stdout.

Callers 1

lib2def.pyFile · 0.85

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected