Made the version number information more robust and uh, informative.
Also added asserts to check that the major.minor versions of wxPython and wxWindows match. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19926 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -12,13 +12,12 @@
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
import __version__
|
||||
__version__ = __version__.ver
|
||||
__version__ = __version__.wxVERSION_STRING
|
||||
|
||||
|
||||
# Ensure the main extension module is loaded, in case the add-on modules
|
||||
# (such as utils,) are used standalone.
|
||||
import wxc
|
||||
wxc.__version__ = __version__
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
@@ -1 +1,12 @@
|
||||
ver = '2.4.0.8p1'
|
||||
# This file was generated by setup.py...
|
||||
|
||||
wxVERSION_STRING = '2.4.0.8p1'
|
||||
wxMAJOR_VERSION = 2
|
||||
wxMINOR_VERSION = 4
|
||||
wxRELEASE_VERSION = 0
|
||||
wxSUBREL_VERSION = 8
|
||||
|
||||
wxVERSION = (wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_VERSION,
|
||||
wxSUBREL_VERSION, 'p1')
|
||||
|
||||
wxRELEASE_NUMBER = wxRELEASE_VERSION # for compatibility
|
||||
|
@@ -654,15 +654,17 @@ if wxPlatform == "__WXMSW__":
|
||||
del os
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# wxWindows version numbers. wxPython version is in __version__.
|
||||
# Load version numbers from __version__... Ensure that major and minor
|
||||
# versions are the same for both wxPython and wxWindows.
|
||||
|
||||
wxMAJOR_VERSION = wxc.wxMAJOR_VERSION
|
||||
wxMINOR_VERSION = wxc.wxMINOR_VERSION
|
||||
wxRELEASE_NUMBER = wxc.wxRELEASE_NUMBER
|
||||
wxVERSION_STRING = wxc.wxVERSION_STRING
|
||||
wxVERSION_NUMBER = wxc.wxVERSION_NUMBER
|
||||
from wxPython.__version__ import *
|
||||
__version__ = wxVERSION_STRING
|
||||
|
||||
wxVERSION = (wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
|
||||
assert wxMAJOR_VERSION == wxc.wxMAJOR_VERSION, "wxPython/wxWindows version mismatch"
|
||||
assert wxMINOR_VERSION == wxc.wxMINOR_VERSION, "wxPython/wxWindows version mismatch"
|
||||
if wxRELEASE_VERSION != wxc.wxRELEASE_VERSION:
|
||||
import warnings
|
||||
warnings.warn("wxPython/wxWindows release number mismatch")
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
@@ -54,9 +54,6 @@
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
||||
#define __version__ "0.0.0" // The real value is now in setup.py...
|
||||
|
||||
%readonly
|
||||
wxPoint wxDefaultPosition;
|
||||
wxSize wxDefaultSize;
|
||||
@@ -287,17 +284,12 @@ static wxPyCoreAPI API = {
|
||||
initfontsc();
|
||||
|
||||
|
||||
// Although these are redfined in __version__ they need to be here too so
|
||||
// that an assert can be done to ensure that the wxPython and the wxWindows
|
||||
// versions match.
|
||||
PyDict_SetItemString(d,"wxMAJOR_VERSION", PyInt_FromLong((long)wxMAJOR_VERSION ));
|
||||
PyDict_SetItemString(d,"wxMINOR_VERSION", PyInt_FromLong((long)wxMINOR_VERSION ));
|
||||
PyDict_SetItemString(d,"wxRELEASE_NUMBER", PyInt_FromLong((long)wxRELEASE_NUMBER ));
|
||||
PyDict_SetItemString(d,"wxVERSION_NUMBER", PyInt_FromLong((long)wxVERSION_NUMBER ));
|
||||
#if wxUSE_UNICODE
|
||||
wxString tempStr(wxVERSION_STRING);
|
||||
PyDict_SetItemString(d,"wxVERSION_STRING", PyUnicode_FromWideChar(tempStr.c_str(), tempStr.Len()));
|
||||
#else
|
||||
PyDict_SetItemString(d,"wxVERSION_STRING", PyString_FromString(wxVERSION_STRING));
|
||||
#endif
|
||||
|
||||
PyDict_SetItemString(d,"wxRELEASE_VERSION", PyInt_FromLong((long)wxRELEASE_NUMBER ));
|
||||
|
||||
%}
|
||||
|
||||
|
Reference in New Issue
Block a user