annotate PC/python33gen.py @ 68071:0f52cfc91fae

More automated version replacement.
author Georg Brandl <georg@python.org>
date Sun, 20 Feb 2011 10:41:31 +0000
parents PC/python32gen.py@062907f685ac
children eb5ed3da6862
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68071
0f52cfc91fae More automated version replacement.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
1 # Generate python33stub.def out of python3.def
66755
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
2 # The regular import library cannot be used,
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
3 # since it doesn't provide the right symbols for
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
4 # data forwarding
68071
0f52cfc91fae More automated version replacement.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
5 out = open("python33stub.def", "w")
0f52cfc91fae More automated version replacement.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
6 out.write('LIBRARY "python33"\n')
66755
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
7 out.write('EXPORTS\n')
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
8
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
9 inp = open("python3.def")
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
10 inp.readline()
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
11 line = inp.readline()
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
12 assert line.strip()=='EXPORTS'
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
13
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
14 for line in inp:
68071
0f52cfc91fae More automated version replacement.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
15 # SYM1=python33.SYM2[ DATA]
66755
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
16 head, tail = line.split('.')
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
17 if 'DATA' in tail:
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
18 symbol, tail = tail.split(' ')
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
19 else:
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
20 symbol = tail.strip()
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
21 out.write(symbol+'\n')
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
22
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
23 inp.close()
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
24 out.close()
062907f685ac Automate build for python3.dll.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
25