MCPcopy Index your code
hub / github.com/python/cpython / parse_dsp

Function parse_dsp

Tools/freeze/checkextensions_win32.py:127–143  ·  view source on GitHub ↗
(dsp)

Source from the content-addressed store, hash-verified

125# Given an MSVC DSP file, locate C source files it uses
126# returns a list of source files.
127def parse_dsp(dsp):
128# print "Processing", dsp
129 # For now, only support
130 ret = []
131 dsp_path, dsp_name = os.path.split(dsp)
132 try:
133 with open(dsp, "r") as fp:
134 lines = fp.readlines()
135 except IOError as msg:
136 sys.stderr.write("%s: %s\n" % (dsp, msg))
137 return None
138 for line in lines:
139 fields = line.strip().split("=", 2)
140 if fields[0]=="SOURCE":
141 if os.path.splitext(fields[1])[1].lower() in ['.cpp', '.c']:
142 ret.append( win32api.GetFullPathName(os.path.join(dsp_path, fields[1] ) ) )
143 return ret
144
145def write_extension_table(fname, modules):
146 fp = open(fname, "w")

Callers 1

get_extension_defnFunction · 0.85

Calls 9

splitextMethod · 0.80
openFunction · 0.70
splitMethod · 0.45
readlinesMethod · 0.45
writeMethod · 0.45
stripMethod · 0.45
lowerMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…