[GRASS-SVN] r45191 - grass/branches/develbranch_6/lib/python
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 26 06:01:21 EST 2011
Author: martinl
Date: 2011-01-26 03:01:21 -0800 (Wed, 26 Jan 2011)
New Revision: 45191
Modified:
grass/branches/develbranch_6/lib/python/core.py
grass/branches/develbranch_6/lib/python/pythonlib.dox
Log:
pythonlib: core::version introduced
Modified: grass/branches/develbranch_6/lib/python/core.py
===================================================================
--- grass/branches/develbranch_6/lib/python/core.py 2011-01-26 10:57:12 UTC (rev 45190)
+++ grass/branches/develbranch_6/lib/python/core.py 2011-01-26 11:01:21 UTC (rev 45191)
@@ -13,7 +13,7 @@
...
@endcode
-(C) 2008-2010 by the GRASS Development Team
+(C) 2008-2011 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.
@@ -1065,7 +1065,22 @@
os.chdir(cur_dir)
except OSError, e:
raise ScriptException(repr(e))
-
+
+# interface to g.version
+
+def version():
+ """!Get GRASS version as dictionary
+
+ @code
+ version()
+
+ {'date': '2010', 'gis_revision': 'Revision: 38990', 'version': '6.5.svn',
+ 'gis_date': 'Date: 2009-09-05 19:01:13 +0200 (Sat, 05 Sep 2009)'}
+ @endcode
+ """
+ return parse_command('g.version',
+ flags = 'rg')
+
# get debug_level
if find_program('g.gisenv', ['--help']):
debug_level = int(gisenv().get('DEBUG', 0))
Modified: grass/branches/develbranch_6/lib/python/pythonlib.dox
===================================================================
--- grass/branches/develbranch_6/lib/python/pythonlib.dox 2011-01-26 10:57:12 UTC (rev 45190)
+++ grass/branches/develbranch_6/lib/python/pythonlib.dox 2011-01-26 11:01:21 UTC (rev 45191)
@@ -171,6 +171,10 @@
- mapsets()
+<b>Interface to g.version</b>
+
+ - python::core::version()
+
<b>Color parsing</b>
- parse_color()
More information about the grass-commit
mailing list