[GRASS-SVN] r54786 - grass/trunk/lib/python/pygrass/vector

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jan 27 08:05:37 PST 2013


Author: zarch
Date: 2013-01-27 08:05:35 -0800 (Sun, 27 Jan 2013)
New Revision: 54786

Modified:
   grass/trunk/lib/python/pygrass/vector/__init__.py
   grass/trunk/lib/python/pygrass/vector/table.py
Log:
Replace script.core.gisenv with pygrass.gis.Mapset

Modified: grass/trunk/lib/python/pygrass/vector/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/__init__.py	2013-01-27 16:05:25 UTC (rev 54785)
+++ grass/trunk/lib/python/pygrass/vector/__init__.py	2013-01-27 16:05:35 UTC (rev 54786)
@@ -18,8 +18,6 @@
 from abstract import Info
 from basic import Bbox
 
-import grass.script.core as core
-_GRASSENV = core.gisenv()
 
 _NUMOF = {"areas": libvect.Vect_get_num_areas,
           "dblinks": libvect.Vect_get_num_dblinks,
@@ -68,7 +66,7 @@
         False
 
     ..
-    """ % _GRASSENV['MAPSET']
+    """
     def __init__(self, name, mapset=''):
         # Set map name and mapset
         super(Vector, self).__init__(name, mapset)

Modified: grass/trunk/lib/python/pygrass/vector/table.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/table.py	2013-01-27 16:05:25 UTC (rev 54785)
+++ grass/trunk/lib/python/pygrass/vector/table.py	2013-01-27 16:05:35 UTC (rev 54786)
@@ -15,7 +15,7 @@
     from pygrass.orderdict import OrderedDict
 
 import grass.lib.vector as libvect
-import grass.script.core as core
+from pygrass.gis import Mapset
 
 import sql
 
@@ -35,10 +35,10 @@
     if "$" not in path:
         return path
     else:
-        grassenv = core.gisenv()
-        path = path.replace('$GISDBASE', grassenv['GISDBASE'])
-        path = path.replace('$LOCATION_NAME', grassenv['LOCATION_NAME'])
-        path = path.replace('$MAPSET', grassenv['MAPSET'])
+        mapset = Mapset()
+        path = path.replace('$GISDBASE', mapset.gisdbase)
+        path = path.replace('$LOCATION_NAME', mapset.location)
+        path = path.replace('$MAPSET', mapset.name)
         return path
 
 



More information about the grass-commit mailing list