Georg Brandl | fa2c61a | 2011-02-20 10:41:31 +0000 | [diff] [blame] | 1 | # Generate python33stub.def out of python3.def
|
Martin v. Löwis | d53ee5d | 2010-12-05 23:07:58 +0000 | [diff] [blame] | 2 | # The regular import library cannot be used,
|
| 3 | # since it doesn't provide the right symbols for
|
| 4 | # data forwarding
|
Georg Brandl | fa2c61a | 2011-02-20 10:41:31 +0000 | [diff] [blame] | 5 | out = open("python33stub.def", "w")
|
| 6 | out.write('LIBRARY "python33"\n')
|
Martin v. Löwis | d53ee5d | 2010-12-05 23:07:58 +0000 | [diff] [blame] | 7 | out.write('EXPORTS\n')
|
| 8 |
|
| 9 | inp = open("python3.def")
|
| 10 | inp.readline()
|
| 11 | line = inp.readline()
|
| 12 | assert line.strip()=='EXPORTS'
|
| 13 |
|
| 14 | for line in inp:
|
Georg Brandl | fa2c61a | 2011-02-20 10:41:31 +0000 | [diff] [blame] | 15 | # SYM1=python33.SYM2[ DATA]
|
Martin v. Löwis | d53ee5d | 2010-12-05 23:07:58 +0000 | [diff] [blame] | 16 | head, tail = line.split('.')
|
| 17 | if 'DATA' in tail:
|
| 18 | symbol, tail = tail.split(' ')
|
| 19 | else:
|
| 20 | symbol = tail.strip()
|
| 21 | out.write(symbol+'\n')
|
| 22 |
|
| 23 | inp.close()
|
| 24 | out.close()
|
| 25 |
|