[GRASS-SVN] r60909 - grass/trunk/lib/python/pygrass/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jun 21 00:46:22 PDT 2014
Author: zarch
Date: 2014-06-21 00:46:22 -0700 (Sat, 21 Jun 2014)
New Revision: 60909
Modified:
grass/trunk/lib/python/pygrass/gis/__init__.py
Log:
Remove unnecessary 'grass.script.gisenv()' as pointed out by Glynn and remove some useless comment
Modified: grass/trunk/lib/python/pygrass/gis/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/gis/__init__.py 2014-06-21 03:49:57 UTC (rev 60908)
+++ grass/trunk/lib/python/pygrass/gis/__init__.py 2014-06-21 07:46:22 UTC (rev 60909)
@@ -9,26 +9,12 @@
import ctypes as ct
import fnmatch
-from grass import script
-#from grass.script import setup
-#
-#
-#GISBASE = "/home/pietro/docdat/src/gis/grass/grass71/dist.x86_64-unknown-linux-gnu"
-#LOCATION = "nc_basic_spm_grass7'"
-#GISDBASE = "/home/pietro/docdat/gis"
-#MAPSET = "sqlite"
-#GUI = "wxpython"
-#
-#setup.init(GISBASE, GISDBASE, LOCATION, MAPSET)
-script.gisenv()
import grass.lib.gis as libgis
from grass.pygrass.functions import getenv
from grass.pygrass.errors import GrassError
-#write dec to check if user have permissions or not
-
ETYPE = {'rast': libgis.G_ELEMENT_RASTER,
'rast3d': libgis.G_ELEMENT_RASTER3D,
'vect': libgis.G_ELEMENT_VECTOR,
@@ -56,7 +42,7 @@
return getenv(type)
else:
raise GrassError("%s <%s> not found" % (type.title(),
- join(path, value)))
+ join(path, value)))
def set_current_mapset(mapset, location=None, gisdbase=None):
@@ -127,7 +113,7 @@
for loc in self.locations():
yield Location(loc, self.name)
- # TODO remove or complete this function
+ # TODO remove or complete this function
def new_location(self):
if libgis.G__make_location() != 0:
raise GrassError("Cannot create new location")
@@ -381,7 +367,6 @@
"""Return the mapsets in the search path"""
with open(self.spath, "a+") as f:
lines = f.readlines()
- #lines.remove('')
if lines:
return [l.strip() for l in lines]
lns = ['PERMANENT', ]
@@ -422,7 +407,7 @@
def extend(self, mapsets):
"""Add more mapsets to the search path
-
+
:param mapsets: a list of mapset's names
:type mapsets: list
"""
More information about the grass-commit
mailing list