[GRASS-SVN] r42554 - in grass/trunk/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:36:52 +0000 (Sun, 13 Jun 2010)
New Revision: 42554
Modified:
grass/trunk/gui/wxpython/gui_modules/globalvar.py
grass/trunk/gui/wxpython/gui_modules/layertree.py
grass/trunk/gui/wxpython/gui_modules/menuform.py
grass/trunk/gui/wxpython/wxgui.py
Log:
fix r42549 (agwStyle available in wxPython 2.8.11+)
Modified: grass/trunk/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/globalvar.py 2010-06-13 15:32:33 UTC (rev 42553)
+++ grass/trunk/gui/wxpython/gui_modules/globalvar.py 2010-06-13 15:36:52 UTC (rev 42554)
@@ -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/trunk/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/layertree.py 2010-06-13 15:32:33 UTC (rev 42553)
+++ grass/trunk/gui/wxpython/gui_modules/layertree.py 2010-06-13 15:36:52 UTC (rev 42554)
@@ -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/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-06-13 15:32:33 UTC (rev 42553)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-06-13 15:36:52 UTC (rev 42554)
@@ -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/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2010-06-13 15:32:33 UTC (rev 42553)
+++ grass/trunk/gui/wxpython/wxgui.py 2010-06-13 15:36:52 UTC (rev 42554)
@@ -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