[GRASS-SVN] r59850 - grass/trunk/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Apr 20 13:20:19 PDT 2014


Author: martinl
Date: 2014-04-20 13:20:19 -0700 (Sun, 20 Apr 2014)
New Revision: 59850

Modified:
   grass/trunk/gui/wxpython/gis_set.py
Log:
wxGUI: show revision number also in welcome screen

Modified: grass/trunk/gui/wxpython/gis_set.py
===================================================================
--- grass/trunk/gui/wxpython/gis_set.py	2014-04-20 20:19:42 UTC (rev 59849)
+++ grass/trunk/gui/wxpython/gis_set.py	2014-04-20 20:20:19 UTC (rev 59850)
@@ -93,9 +93,16 @@
 
         # labels
         ### crashes when LOCATION doesn't exist
+        # get version & revision
         versionFile = open(os.path.join(globalvar.ETCDIR, "VERSIONNUMBER"))
-        grassVersion = versionFile.readline().split(' ')[0].rstrip('\n')
+        versionLine = versionFile.readline().rstrip('\n')
         versionFile.close()
+        try:
+            grassVersion, grassRevision = versionLine.split(' ', 1)
+            grassRevisionStr = ' (%s)' % grassRevision
+        except ValueError:
+            grassVersion = versionLine
+            grassRevisionStr = ''
         
         self.select_box = wx.StaticBox (parent = self.panel, id = wx.ID_ANY,
                                         label = " %s " % _("Choose project location and mapset"))
@@ -103,8 +110,8 @@
         self.manage_box = wx.StaticBox (parent = self.panel, id = wx.ID_ANY,
                                         label = " %s " % _("Manage"))
         self.lwelcome = wx.StaticText(parent = self.panel, id = wx.ID_ANY,
-                                      label = _("Welcome to GRASS GIS %s\n"
-                                              "The world's leading open source GIS") % grassVersion,
+                                      label = _("Welcome to GRASS GIS %s%s\n"
+                                              "The world's leading open source GIS") % (grassVersion, grassRevisionStr),
                                       style = wx.ALIGN_CENTRE)
         self.ltitle = wx.StaticText(parent = self.panel, id = wx.ID_ANY,
                                     label = _("Select an existing project location and mapset\n"



More information about the grass-commit mailing list