[GRASS-SVN] r64148 - grass/trunk/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 13 12:10:04 PST 2015


Author: martinl
Date: 2015-01-13 12:10:04 -0800 (Tue, 13 Jan 2015)
New Revision: 64148

Modified:
   grass/trunk/gui/wxpython/core/globalvar.py
Log:
wxGUI: modify CheckForWx() to enable selection of wxPython version (eg. 2.8 over 3.0)

Modified: grass/trunk/gui/wxpython/core/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/core/globalvar.py	2015-01-13 19:56:50 UTC (rev 64147)
+++ grass/trunk/gui/wxpython/core/globalvar.py	2015-01-13 20:10:04 UTC (rev 64148)
@@ -49,8 +49,11 @@
 
     return True
 
-def CheckForWx():
-    """Try to import wx module and check its version"""
+def CheckForWx(forceVersion = None):
+    """Try to import wx module and check its version
+
+    :param forceVersion: force wxPython version, eg. '2.8'
+    """
     if 'wx' in sys.modules.keys():
         return
 
@@ -60,7 +63,8 @@
             import wxversion
         except ImportError as e:
             raise ImportError(e)
-        # wxversion.select(str(minVersion[0]) + '.' + str(minVersion[1]))
+        if forceVersion:
+            wxversion.select(forceVersion)
         wxversion.ensureMinimal(str(minVersion[0]) + '.' + str(minVersion[1]))
         import wx
         version = wx.version().split(' ')[0]



More information about the grass-commit mailing list