[GRASS-SVN] r42552 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 13 05:14:23 EDT 2010


Author: martinl
Date: 2010-06-13 15:31:00 +0000 (Sun, 13 Jun 2010)
New Revision: 42552

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
fix r42550 (agwStyle available in wxPython 2.8.11+)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2010-06-13 14:25:04 UTC (rev 42551)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py	2010-06-13 15:31:00 UTC (rev 42552)
@@ -33,6 +33,14 @@
 # wxversion.select() called once at the beginning
 check = True
 
+def CheckWxVersion(version = [2, 8, 11, 0]):
+    """!Check wx version"""
+    ver = wx.version().split(' ')[0]
+    if map(int, ver.split('.')) <= version:
+        return False
+    
+    return True
+
 def CheckForWx():
     """!Try to import wx module and check its version"""
     global check

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2010-06-13 14:25:04 UTC (rev 42551)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py	2010-06-13 15:31:00 UTC (rev 42552)
@@ -25,18 +25,18 @@
 import wx
 try:
     import wx.lib.agw.customtreectrl as CT
-    hasAgw = True
 except ImportError:
     import wx.lib.customtreectrl as CT
-    hasAgw = False
 import wx.combo
 import wx.lib.newevent
 import wx.lib.buttons  as  buttons
 
+import globalvar
+hasAgw = globalvar.CheckWxVersion()
+
 from grass.script import core as grass
 
 import gdialogs
-import globalvar
 import menuform
 import toolbars
 import mapdisp

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-06-13 14:25:04 UTC (rev 42551)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-06-13 15:31:00 UTC (rev 42552)
@@ -71,10 +71,9 @@
 import wx.html
 try:
     import wx.lib.agw.flatnotebook as FN
-    hasAgw = True
 except ImportError:
     import wx.lib.flatnotebook as FN
-    hasAgw = False
+hasAgw = globalvar.CheckWxVersion()
 import wx.lib.colourselect as csel
 import wx.lib.filebrowsebutton as filebrowse
 from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-06-13 14:25:04 UTC (rev 42551)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-06-13 15:31:00 UTC (rev 42552)
@@ -53,11 +53,10 @@
 try:
     import wx.lib.agw.customtreectrl as CT
     import wx.lib.agw.flatnotebook   as FN
-    hasAgw = True
 except ImportError:
     import wx.lib.customtreectrl as CT
     import wx.lib.flatnotebook   as FN
-    hasAgw = False
+hasAgw = globalvar.CheckWxVersion()
 
 sys.path.append(os.path.join(globalvar.ETCDIR, "python"))
 from grass.script import core as grass



More information about the grass-commit mailing list