]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/create_setup.h.py
wx.ProgressDialog.Update now returns two values.
[wxWidgets.git] / wxPython / distrib / create_setup.h.py
CommitLineData
f58a6c81
KO
1import sys, os, string, shutil, re
2
3#TODO: copy .make files to build/msw
4
5# update setup_h defines to match official wxPython settings
2458faeb
DS
6defines = {
7 'wxDIALOG_UNIT_COMPATIBILITY' :'0',
8 'wxUSE_DEBUG_CONTEXT' :'0',
9 'wxUSE_MEMORY_TRACING' :'0',
10 'wxUSE_DIALUP_MANAGER' :'0',
11 'wxUSE_GLCANVAS' :'1',
12 'wxUSE_POSTSCRIPT' :'1',
13 'wxUSE_AFM_FOR_POSTSCRIPT' :'0',
14 'wxUSE_DISPLAY' :'1',
15 'wxUSE_DEBUGREPORT' :'0'
16}
f58a6c81
KO
17
18uni_defines = {
2458faeb
DS
19 'wxUSE_UNICODE' :'1',
20 'wxUSE_UNICODE_MSLU' :'1'
f58a6c81
KO
21}
22
23debug_defines = {
2458faeb
DS
24 'wxUSE_DEBUG_CONTEXT' :'1',
25 'wxUSE_MEMORY_TRACING' :'1',
f58a6c81
KO
26}
27
28if "UNICODE=1" in sys.argv:
29 defines.update(uni_defines)
30
31if "DEBUG=1" in sys.argv:
32 defines.update(debug_defines)
33
34setup_dir = os.path.join("..", "..", "include", "wx", "msw")
35
36# copy the file over if it doesn't exist
37setup_h = os.path.join(setup_dir, "setup.h")
38setup0_h = os.path.join(setup_dir, "setup0.h")
39if not os.path.exists(setup_h) and os.path.exists(setup0_h):
40 shutil.copyfile(setup0_h, setup_h)
41
42setup_file = open(setup_h, "rb").read()
43
44for define in defines:
45 setup_file, num_subs = re.subn("%s\s+\d" % (define), "%s\t%s" % (define, defines[define]), setup_file)
46 print "# of subs made for pattern %s: %d" % (define, num_subs)
47
48output = open(setup_h, "wb")
49output.write(setup_file)
50output.close()