Browse Source

wxGUI: show revision number also in welcome screen
(merge https://trac.osgeo.org/grass/changeset/59850 + https://trac.osgeo.org/grass/changeset/59852 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@59876 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 11 years ago
parent
commit
20c6fee808
1 changed files with 14 additions and 4 deletions
  1. 14 4
      gui/wxpython/gis_set.py

+ 14 - 4
gui/wxpython/gis_set.py

@@ -11,7 +11,7 @@ Classes:
  - gis_set::GListBox
  - gis_set::StartUp
 
-(C) 2006-2013 by the GRASS Development Team
+(C) 2006-2014 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -93,9 +93,19 @@ class GRASSStartup(wx.Frame):
 
         # 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)
+            if grassVersion.endswith('svn'):
+                grassRevisionStr = ' (%s)' % grassRevision
+            else:
+                grassRevisionStr = ''
+        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 +113,8 @@ class GRASSStartup(wx.Frame):
         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"