[GRASS-SVN] r46949 - in grass/trunk/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 4 04:05:40 EDT 2011


Author: martinl
Date: 2011-07-04 01:05:40 -0700 (Mon, 04 Jul 2011)
New Revision: 46949

Modified:
   grass/trunk/gui/wxpython/gis_set.py
   grass/trunk/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix startup dialog when gisdbase is not available
       (merge r46947 from relbr64)


Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2011-07-04 08:02:12 UTC (rev 46948)
+++ grass/trunk/gui/wxpython/gis_set.py	2011-07-04 08:05:40 UTC (rev 46949)
@@ -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/trunk/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/utils.py	2011-07-04 08:02:12 UTC (rev 46948)
+++ grass/trunk/gui/wxpython/gui_modules/utils.py	2011-07-04 08:05:40 UTC (rev 46949)
@@ -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