diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-02 17:43:40 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-02 17:43:40 (GMT) |
commit | d9fbab2621d1a6f35be106873d02408174c59b11 (patch) | |
tree | 8c023e31eb4027b28f7e9a37213912b43444efef /PC/VS8.0/field3.py | |
parent | 0a11232978b250c5b0e2af17888201eed8344e52 (diff) | |
download | cpython-d9fbab2621d1a6f35be106873d02408174c59b11.zip cpython-d9fbab2621d1a6f35be106873d02408174c59b11.tar.gz cpython-d9fbab2621d1a6f35be106873d02408174c59b11.tar.bz2 |
Removed PCbuild8/ directory and added a new build directory for VS 2005
based on the VS 2008 build directory to PC/VS8.0. The script
PCbuild/vs8to9.py was added to sync changes from PCbuild to PC/VS8.0.
Kristjan, the initial creator of the PCbuild8 directory is fine with the replacement. I've moved the new version of the VS 2005 build directory next to the other legacy build directories. The new sync script is based on the work of wreck and syncs changes in the project, property and solution files.
Diffstat (limited to 'PC/VS8.0/field3.py')
-rw-r--r-- | PC/VS8.0/field3.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/PC/VS8.0/field3.py b/PC/VS8.0/field3.py new file mode 100644 index 0000000..edcbe36 --- /dev/null +++ b/PC/VS8.0/field3.py @@ -0,0 +1,35 @@ +# An absurd workaround for the lack of arithmetic in MS's resource compiler. +# After building Python, run this, then paste the output into the appropriate +# part of PC\python_nt.rc. +# Example output: +# +# * For 2.3a0, +# * PY_MICRO_VERSION = 0 +# * PY_RELEASE_LEVEL = 'alpha' = 0xA +# * PY_RELEASE_SERIAL = 1 +# * +# * and 0*1000 + 10*10 + 1 = 101. +# */ +# #define FIELD3 101 + +import sys + +major, minor, micro, level, serial = sys.version_info +levelnum = {'alpha': 0xA, + 'beta': 0xB, + 'candidate': 0xC, + 'final': 0xF, + }[level] +string = sys.version.split()[0] # like '2.3a0' + +print(" * For %s," % string) +print(" * PY_MICRO_VERSION = %d" % micro) +print(" * PY_RELEASE_LEVEL = %r = %s" % (level, hex(levelnum))) +print(" * PY_RELEASE_SERIAL = %d" % serial) +print(" *") + +field3 = micro * 1000 + levelnum * 10 + serial + +print(" * and %d*1000 + %d*10 + %d = %d" % (micro, levelnum, serial, field3)) +print(" */") +print("#define FIELD3", field3) |