annotate PC/python32gen.py @ 78335:fd5166fdb978 3.2

Issue #12288: Consider '0' and '0.0' as valid initialvalue for tkinter SimpleDialog.
author Andrew Svetlov <andrew.svetlov@gmail.com>
date Mon, 30 Jul 2012 19:59:53 +0300
parents 1ea492ea40fd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68253
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
1 # Generate python32stub.def out of python3.def
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
2 # The regular import library cannot be used,
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
3 # since it doesn't provide the right symbols for
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
4 # data forwarding
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
5 out = open("python32stub.def", "w")
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
6 out.write('LIBRARY "python32"\n')
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
7 out.write('EXPORTS\n')
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
8
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
9 inp = open("python3.def")
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
10 inp.readline()
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
11 line = inp.readline()
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
12 assert line.strip()=='EXPORTS'
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
13
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
14 for line in inp:
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
15 # SYM1=python32.SYM2[ DATA]
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
16 head, tail = line.split('.')
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
17 if 'DATA' in tail:
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
18 symbol, tail = tail.split(' ')
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
19 else:
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
20 symbol = tail.strip()
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
21 out.write(symbol+'\n')
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
22
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
23 inp.close()
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
24 out.close()
1ea492ea40fd Add updated .hgeol file and fix newlines in the 3.2 branch.
Georg Brandl <georg@python.org>
parents: 66755
diff changeset
25