mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 01:30:07 +01:00
Add an item to wx.PlatformInfo and wx.__version__ indicating build type:
Development, snapshot or release
This commit is contained in:
3
build.py
3
build.py
@@ -1368,6 +1368,9 @@ def cmd_build_py(options, args):
|
||||
|
||||
BUILD_DIR = getBuildDir(options)
|
||||
|
||||
if options.release:
|
||||
os.environ['WXPYTHON_RELEASE'] = 'yes'
|
||||
|
||||
if not isWindows:
|
||||
WX_CONFIG = posixjoin(BUILD_DIR, 'wx-config')
|
||||
if options.use_syswx:
|
||||
|
||||
@@ -337,8 +337,16 @@ class Configuration(object):
|
||||
# is a release build. (In theory)
|
||||
if os.path.exists('REV.txt'):
|
||||
f = open('REV.txt')
|
||||
self.VER_FLAGS += f.read().strip()
|
||||
txt = f.read().strip()
|
||||
self.VER_FLAGS += txt
|
||||
if txt[0] == '.':
|
||||
txt = txt[1:]
|
||||
self.BUILD_TYPE = txt
|
||||
f.close()
|
||||
elif os.environ.get('WXPYTHON_RELEASE') == 'yes':
|
||||
self.BUILD_TYPE = "release"
|
||||
else:
|
||||
self.BUILD_TYPE = "devel"
|
||||
|
||||
self.VERSION = "%s.%s.%s%s" % (self.VER_MAJOR,
|
||||
self.VER_MINOR,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# This file was generated by Phoenix's wscript.
|
||||
# This file was generated by wxPython's wscript.
|
||||
|
||||
VERSION_STRING = '4.0.0rc1'
|
||||
|
||||
@@ -6,6 +6,9 @@ if 'wxEVT_NULL' in dir():
|
||||
import wx._core
|
||||
__version__ = VERSION_STRING
|
||||
|
||||
# Add the build type to PlatformInfo
|
||||
PlatformInfo = PlatformInfo + ('build-type: ' + BUILD_TYPE, )
|
||||
|
||||
# Register a function to be called when Python terminates that will clean
|
||||
# up and release all system resources that wxWidgets allocated.
|
||||
import atexit
|
||||
|
||||
9
wscript
9
wscript
@@ -34,7 +34,7 @@ def options(opt):
|
||||
opt.load('python')
|
||||
|
||||
opt.add_option('--debug', dest='debug', action='store_true', default=False,
|
||||
help='Turn on debug compile options.')
|
||||
help='Turn on debugger-related compile options.')
|
||||
opt.add_option('--python', dest='python', default='', action='store',
|
||||
help='Full path to the Python executable to use.')
|
||||
opt.add_option('--wx_config', dest='wx_config', default='wx-config', action='store',
|
||||
@@ -482,16 +482,17 @@ def build(bld):
|
||||
|
||||
# create the package's __version__ module
|
||||
open(opj(cfg.PKGDIR, '__version__.py'), 'w').write(
|
||||
"# This file was generated by Phoenix's wscript.\n\n"
|
||||
"# This file was generated by wxPython's wscript.\n\n"
|
||||
"VERSION_STRING = '%(VERSION)s'\n"
|
||||
"MAJOR_VERSION = %(VER_MAJOR)s\n"
|
||||
"MINOR_VERSION = %(VER_MINOR)s\n"
|
||||
"RELEASE_NUMBER = %(VER_RELEASE)s\n\n"
|
||||
"RELEASE_NUMBER = %(VER_RELEASE)s\n"
|
||||
"BUILD_TYPE = '%(BUILD_TYPE)s'\n\n"
|
||||
"VERSION = (MAJOR_VERSION, MINOR_VERSION, RELEASE_NUMBER, '%(VER_FLAGS)s')\n"
|
||||
% cfg.__dict__)
|
||||
# and one for the demo folder too
|
||||
open('demo/version.py', 'w').write(
|
||||
"# This file was generated by Phoenix's wscript.\n\n"
|
||||
"# This file was generated by wxPython's wscript.\n\n"
|
||||
"VERSION_STRING = '%(VERSION)s'\n"
|
||||
% cfg.__dict__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user