[GRASS-SVN] r46948 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 4 04:02:12 EDT 2011


Author: martinl
Date: 2011-07-04 01:02:12 -0700 (Mon, 04 Jul 2011)
New Revision: 46948

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


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