diff --git a/wxPython/demo/run.py b/wxPython/demo/run.py index d0734b6c97..3c27661e9e 100755 --- a/wxPython/demo/run.py +++ b/wxPython/demo/run.py @@ -21,7 +21,7 @@ import wx # This module uses the new wx namespace import sys, os # 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() ##raw_input("Press Enter...") diff --git a/wxPython/src/_core_ex.py b/wxPython/src/_core_ex.py index cf46d72114..bb3658d73c 100644 --- a/wxPython/src/_core_ex.py +++ b/wxPython/src/_core_ex.py @@ -30,6 +30,24 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION: import warnings 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