Преглед на файлове

wxGUI: call wxversion.select() just once at the beginning

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32342 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa преди 16 години
родител
ревизия
20ac82c57a
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9 0
      gui/wxpython/gui_modules/globalvar.py

+ 9 - 0
gui/wxpython/gui_modules/globalvar.py

@@ -23,8 +23,15 @@ import locale
 import gettext
 gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode=True)
 
+# wxversion.select() called once at the beginning
+check = True
+
 def CheckForWx():
     """Try to import wx module and check its version"""
+    global check
+    if not check:
+        return
+    
     minVersion = [2, 8, 1, 1]
     try:
         import wxversion
@@ -42,6 +49,8 @@ def CheckForWx():
         print >> sys.stderr, "Unable to set locale:", e
         os.environ['LC_ALL'] = ''
 
+    check = False
+
 CheckForWx()
 import wx
 import wx.lib.flatnotebook as FN