Преглед изворни кода

wxGUI: show revision number also in welcome screen

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59850 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa пре 11 година
родитељ
комит
d7100264ee
1 измењених фајлова са 10 додато и 3 уклоњено
  1. 10 3
      gui/wxpython/gis_set.py

+ 10 - 3
gui/wxpython/gis_set.py

@@ -93,9 +93,16 @@ 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)
+            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 @@ 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"