[GRASS-SVN] r46096 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 25 05:44:27 EDT 2011


Author: martinl
Date: 2011-04-25 02:44:27 -0700 (Mon, 25 Apr 2011)
New Revision: 46096

Modified:
   grass/trunk/gui/wxpython/gui_modules/globalvar.py
Log:
wxGUI: ensure that wxversion.ensureMinimal() is not called when wx
modules is already imported


Modified: grass/trunk/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/globalvar.py	2011-04-25 02:18:38 UTC (rev 46095)
+++ grass/trunk/gui/wxpython/gui_modules/globalvar.py	2011-04-25 09:44:27 UTC (rev 46096)
@@ -33,9 +33,6 @@
 sys.path.append(os.path.join(ETCDIR, "python"))
 import grass.script as grass
 
-# wxversion.select() called once at the beginning
-check = True
-
 def CheckWxVersion(version = [2, 8, 11, 0]):
     """!Check wx version"""
     ver = wx.version().split(' ')[0]
@@ -46,9 +43,9 @@
 
 def CheckForWx():
     """!Try to import wx module and check its version"""
-    global check
-    if not check:
+    if 'wx' in sys.modules.keys():
         return
+    
     minVersion = [2, 8, 1, 1]
     try:
         try:
@@ -73,9 +70,7 @@
     except locale.Error, e:
         print >> sys.stderr, "Unable to set locale:", e
         os.environ['LC_ALL'] = ''
-
-    check = False
-
+    
 if not os.getenv("GRASS_WXBUNDLED"):
     CheckForWx()
 import wx



More information about the grass-commit mailing list