[GRASS-SVN] r42555 - in
grass/branches/releasebranch_6_4/gui/wxpython: . gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jun 13 05:12:41 EDT 2010
Author: martinl
Date: 2010-06-13 15:38:12 +0000 (Sun, 13 Jun 2010)
New Revision: 42555
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py
grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py
Log:
fix r42551 (agwStyle available in wxPython 2.8.11+)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py 2010-06-13 15:36:52 UTC (rev 42554)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/globalvar.py 2010-06-13 15:38:12 UTC (rev 42555)
@@ -26,6 +26,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/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py 2010-06-13 15:36:52 UTC (rev 42554)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py 2010-06-13 15:38:12 UTC (rev 42555)
@@ -69,10 +69,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/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py 2010-06-13 15:36:52 UTC (rev 42554)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/wxgui_utils.py 2010-06-13 15:38:12 UTC (rev 42555)
@@ -27,16 +27,16 @@
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()
+
import gdialogs
-import globalvar
import menuform
import toolbars
import mapdisp
Modified: grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py 2010-06-13 15:36:52 UTC (rev 42554)
+++ grass/branches/releasebranch_6_4/gui/wxpython/wxgui.py 2010-06-13 15:38:12 UTC (rev 42555)
@@ -68,11 +68,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()
try:
import subprocess
More information about the grass-commit
mailing list