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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 28 07:40:49 PST 2014


Author: zarch
Date: 2014-01-28 07:40:49 -0800 (Tue, 28 Jan 2014)
New Revision: 58792

Modified:
   grass/trunk/lib/python/pygrass/vector/__init__.py
Log:
Use Location instance instead of gisenv

Modified: grass/trunk/lib/python/pygrass/vector/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/__init__.py	2014-01-28 15:37:02 UTC (rev 58791)
+++ grass/trunk/lib/python/pygrass/vector/__init__.py	2014-01-28 15:40:49 UTC (rev 58792)
@@ -228,12 +228,9 @@
         >>> mycens.close()
         >>> remove('mycensus', 'vect')
         """
-        path = os.path.join(gisenv()['GISDBASE'], gisenv()['LOCATION_NAME'],
-                            self.mapset, 'vector', self.name, 'colr')
-        if os.path.exists(path):
-            return True
-        else:
-            return False
+        loc = Location()
+        path = join(loc.path(), self.mapset, 'vector', self.name, 'colr')
+        return True if exists(path) else False
 
 
 #=============================================



More information about the grass-commit mailing list