[GRASS-SVN] r46947 - in grass/branches/releasebranch_6_4/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 4 04:00:07 EDT 2011


Author: martinl
Date: 2011-07-04 01:00:07 -0700 (Mon, 04 Jul 2011)
New Revision: 46947

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix startup dialog when gisdbase is not available


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2011-07-04 07:46:36 UTC (rev 46946)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gis_set.py	2011-07-04 08:00:07 UTC (rev 46947)
@@ -91,7 +91,7 @@
         versionFile = open(os.path.join(globalvar.ETCDIR, "VERSIONNUMBER"))
         grassVersion = versionFile.readline().split(' ')[0].rstrip('\n')
         versionFile.close()
-
+        
         self.select_box = wx.StaticBox (parent = self.panel, id = wx.ID_ANY,
                                         label = " %s " % _("Choose project location and mapset"))
 

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py	2011-07-04 07:46:36 UTC (rev 46946)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py	2011-07-04 08:00:07 UTC (rev 46947)
@@ -756,7 +756,14 @@
 def GetSettingsPath():
     """!Get full path to the settings directory
     """
-    version = int(grass.version()['version'].split('.', 1)[0])
+    try:
+        verFd = open(os.path.join(globalvar.ETCDIR, "VERSIONNUMBER"))
+        version = int(verFd.readlines()[0].split(' ')[0].split('.')[0])
+    except (IOError, ValueError, TypeError, IndexError), e:
+        sys.exit(_("ERROR: Unable to determine GRASS version. Details: %s") % e)
+    
+    verFd.close()
+    
     if sys.platform == 'win32':
         return os.path.join(os.getenv('APPDATA'), '.grass%d' % version)
     



More information about the grass-commit mailing list