FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python/PCbuild/field3.py at master · java66liu/python · GitHub
java66liu
/
python
Public
forked from
glix/python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python
/
PCbuild
/
field3.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (30 loc) · 974 Bytes
Breadcrumbs
python
/
PCbuild
/
field3.py
Copy path
File metadata and controls
35 lines (30 loc) · 974 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
)
Back
|
FazBrowse Home
|
New Git URL