[GRASS-SVN] r54051 - grass/trunk/lib/python/pygrass
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Nov 26 08:08:51 PST 2012
Author: zarch
Date: 2012-11-26 08:08:51 -0800 (Mon, 26 Nov 2012)
New Revision: 54051
Modified:
grass/trunk/lib/python/pygrass/functions.py
Log:
Add a new function to get grass environment variables
Modified: grass/trunk/lib/python/pygrass/functions.py
===================================================================
--- grass/trunk/lib/python/pygrass/functions.py 2012-11-26 15:58:51 UTC (rev 54050)
+++ grass/trunk/lib/python/pygrass/functions.py 2012-11-26 16:08:51 UTC (rev 54051)
@@ -14,6 +14,7 @@
from pygrass.errors import GrassError
from pygrass.region import Region
+
def looking(filter_string, obj):
"""
>>> import grass.lib.vector as libvect
@@ -43,6 +44,16 @@
new=newmap), })
+def getenv(env):
+ """Return the current grass environment variables:
+
+ >>> getenv("MAPSET")
+ 'user1'
+
+ .."""
+ return libgis.G__getenv(env)
+
+
def get_mapset_raster(mapname, mapset=''):
return libgis.G_find_raster(mapname, '')
More information about the grass-commit
mailing list