[GRASS-SVN] r71346 - in grass/trunk/gui/wxpython: . core
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 8 15:39:46 PDT 2017
Author: annakrat
Date: 2017-08-08 15:39:46 -0700 (Tue, 08 Aug 2017)
New Revision: 71346
Modified:
grass/trunk/gui/wxpython/core/globalvar.py
grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: fix problems with imports from r71332 which caused GUI crash
Modified: grass/trunk/gui/wxpython/core/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/core/globalvar.py 2017-08-08 20:31:52 UTC (rev 71345)
+++ grass/trunk/gui/wxpython/core/globalvar.py 2017-08-08 22:39:46 UTC (rev 71346)
@@ -55,10 +55,17 @@
def CheckWxVersion(version):
"""Check wx version"""
ver = wx.__version__
- # don't fail on wxPython 4.0.0aX
- if 'a' in ver: # can be removed when 4.0.0 will be out
- ver = ver[0:ver.find('a')]
- if list(map(int, ver.split('.'))) < version:
+ try:
+ split_ver = ver.split('.')
+ parsed_version = list(map(int, split_ver))
+ except ValueError:
+ # wxPython 4.0.0aX
+ for i, c in enumerate(split_ver[-1]):
+ if not c.isdigit():
+ break
+ parsed_version = list(map(int, split_ver[:-1])) + [int(split_ver[-1][:i])]
+
+ if parsed_version < version:
return False
return True
Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2017-08-08 20:31:52 UTC (rev 71345)
+++ grass/trunk/gui/wxpython/wxgui.py 2017-08-08 22:39:46 UTC (rev 71346)
@@ -77,12 +77,21 @@
weight=wx.BOLD))
splash.SetTextPosition((150, 430))
else:
- wx.SplashScreen(
- bitmap=introBmp,
- splashStyle=wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
- milliseconds=2000,
- parent=None,
- id=wx.ID_ANY)
+ if globalvar.wxPythonPhoenix:
+ import wx.adv as wxadv
+ wxadv.SplashScreen(
+ bitmap=introBmp,
+ splashStyle=wxadv.SPLASH_CENTRE_ON_SCREEN | wxadv.SPLASH_TIMEOUT,
+ milliseconds=2000,
+ parent=None,
+ id=wx.ID_ANY)
+ else:
+ wx.SplashScreen(
+ bitmap=introBmp,
+ splashStyle=wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
+ milliseconds=2000,
+ parent=None,
+ id=wx.ID_ANY)
wx.Yield()
More information about the grass-commit
mailing list