ยปCore Development>Code coverage>PC/python34gen.py

Python code coverage for PC/python34gen.py

#countcontent
1n/a# Generate python34stub.def out of python3.def
2n/a# The regular import library cannot be used,
3n/a# since it doesn't provide the right symbols for
4n/a# data forwarding
5n/aout = open("python34stub.def", "w")
6n/aout.write('LIBRARY "python34"\n')
7n/aout.write('EXPORTS\n')
8n/a
9n/ainp = open("python3.def")
10n/aline = inp.readline()
11n/awhile line.strip().startswith(';'):
12n/a line = inp.readline()
13n/aline = inp.readline() # LIBRARY
14n/aassert line.strip()=='EXPORTS'
15n/a
16n/afor line in inp:
17n/a # SYM1=python34.SYM2[ DATA]
18n/a head, tail = line.split('.')
19n/a if 'DATA' in tail:
20n/a symbol, tail = tail.split(' ')
21n/a else:
22n/a symbol = tail.strip()
23n/a out.write(symbol+'\n')
24n/a
25n/ainp.close()
26n/aout.close()