[GRASS-SVN] r59847 - grass/trunk/lib/init

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


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

Modified:
   grass/trunk/lib/init/grass.py
Log:
grass.py: show also revision number if available


Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py	2014-04-20 18:09:26 UTC (rev 59846)
+++ grass/trunk/lib/init/grass.py	2014-04-20 20:18:04 UTC (rev 59847)
@@ -1002,8 +1002,16 @@
 
 def say_hello():
     sys.stderr.write(_("Welcome to GRASS %s") % grass_version)
+    try:
+        filerev = open(os.path.join(gisbase, 'etc', 'VERSIONNUMBER'))
+        linerev = filerev.readline().rstrip('\n')
+        filerev.close()
+        
+        revision = linerev.split(' ')[1]
+        sys.stderr.write(' (' + revision + ')')
+    except:
+        pass
 
-
 def show_info():
     sys.stderr.write(
 r"""



More information about the grass-commit mailing list