[GRASS-SVN] r47980 - grass/branches/releasebranch_6_4/lib/python

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 30 12:37:08 EDT 2011


Author: martinl
Date: 2011-08-30 09:37:08 -0700 (Tue, 30 Aug 2011)
New Revision: 47980

Modified:
   grass/branches/releasebranch_6_4/lib/python/core.py
Log:
pythonlib: format version() output
          (merge r47977 from trunk)


Modified: grass/branches/releasebranch_6_4/lib/python/core.py
===================================================================
--- grass/branches/releasebranch_6_4/lib/python/core.py	2011-08-30 16:33:31 UTC (rev 47979)
+++ grass/branches/releasebranch_6_4/lib/python/core.py	2011-08-30 16:37:08 UTC (rev 47980)
@@ -1022,14 +1022,18 @@
     """!Get GRASS version as dictionary
 
     @code
-    version()
+    print version()
 
-    {'date': '2011', 'libgis_revision': '45093 ', 'version': '6.4.svn',
-     'libgis_date': '2011-01-20 13:10:50 +0100 (Thu, 20 Jan 2011) ', 'revision': '45136'}
+    {'date': '2011', 'libgis_date': '2011-04-13 13:19:03 +0200 (Wed, 13 Apr 2011)',
+    'version': '6.4.2svn', 'libgis_revision': '45934', 'revision': '47445'}
     @endcode
     """
-    return parse_command('g.version',
+    data = parse_command('g.version',
                          flags = 'rg')
+    for k, v in data.iteritems():
+        data[k.strip()] = v.replace('"', '').strip()
+        
+    return data
 
 # get debug_level
 if find_program('g.gisenv', ['--help']):



More information about the grass-commit mailing list