Add wx.version()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -21,7 +21,7 @@ import wx # This module uses the new wx namespace
|
|||||||
import sys, os
|
import sys, os
|
||||||
|
|
||||||
# stuff for debugging
|
# stuff for debugging
|
||||||
print "wx.VERSION_STRING = %s (%s)" % (wx.VERSION_STRING, wx.USE_UNICODE and 'unicode' or 'ansi')
|
print "wx.version:", wx.version()
|
||||||
print "pid:", os.getpid()
|
print "pid:", os.getpid()
|
||||||
##raw_input("Press Enter...")
|
##raw_input("Press Enter...")
|
||||||
|
|
||||||
|
@@ -30,6 +30,24 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION:
|
|||||||
import warnings
|
import warnings
|
||||||
warnings.warn("wxPython/wxWidgets release number mismatch")
|
warnings.warn("wxPython/wxWidgets release number mismatch")
|
||||||
|
|
||||||
|
|
||||||
|
def version():
|
||||||
|
"""Returns a string containing version and port info"""
|
||||||
|
ctype = wx.USE_UNICODE and 'unicode' or 'ansi'
|
||||||
|
if wx.Platform == '__WXMSW__':
|
||||||
|
port = 'msw'
|
||||||
|
elif wx.Platform == '__WXMAC__':
|
||||||
|
port = 'mac'
|
||||||
|
elif wx.Platform == '__WXGTK__':
|
||||||
|
port = 'gtk'
|
||||||
|
if 'gtk2' in wx.PlatformInfo:
|
||||||
|
port = 'gtk2'
|
||||||
|
else:
|
||||||
|
port = '?'
|
||||||
|
|
||||||
|
return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype)
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
# Set wxPython's default string<-->unicode conversion encoding from
|
# Set wxPython's default string<-->unicode conversion encoding from
|
||||||
|
Reference in New Issue
Block a user