[GRASS-SVN] r55661 - in grass-addons/grass7/raster/r.agent: libagent tests
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Apr 8 06:51:31 PDT 2013
Author: mic
Date: 2013-04-08 06:51:31 -0700 (Mon, 08 Apr 2013)
New Revision: 55661
Modified:
grass-addons/grass7/raster/r.agent/libagent/grassland.py
grass-addons/grass7/raster/r.agent/tests/test_grassland.py
Log:
do not enforce current mapset
Modified: grass-addons/grass7/raster/r.agent/libagent/grassland.py
===================================================================
--- grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-04-08 13:25:25 UTC (rev 55660)
+++ grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-04-08 13:51:31 UTC (rev 55661)
@@ -34,7 +34,7 @@
"""
layer = garray.array()
# fill the new grass array with the contents from the map (must exist)
- if grassmapname in grass.list_grouped('rast')[grass.gisenv()['MAPSET']]:
+ if grassmapname in grass.list_strings('rast'):
layer.read(grassmapname)
self.grassmapnames[layername] = grassmapname
self.setlayer(layername, layer, force)
@@ -79,7 +79,7 @@
"Grass Map name is empty.")
if self.layers.has_key(layername):
if grassmapname in \
- grass.list_grouped('rast')[grass.gisenv()['MAPSET']]:
+ grass.list_strings('rast'):
if force:
force="force"
else:
@@ -98,7 +98,7 @@
@param boolean optional, whether an existing file may be overwritten
"""
vectors = []
- if grassmapname in grass.list_grouped('vect')[grass.gisenv()['MAPSET']]:
+ if grassmapname in grass.list_strings('vect'):
layer = grass.vector_db_select(grassmapname)['values']
# TODO only points are supported, ask some expert how to test this
# TODO indexing seems to start at "1".. verify!
Modified: grass-addons/grass7/raster/r.agent/tests/test_grassland.py
===================================================================
--- grass-addons/grass7/raster/r.agent/tests/test_grassland.py 2013-04-08 13:25:25 UTC (rev 55660)
+++ grass-addons/grass7/raster/r.agent/tests/test_grassland.py 2013-04-08 13:51:31 UTC (rev 55661)
@@ -9,11 +9,11 @@
class TestGrassland(unittest.TestCase):
def setUp(self):
# TODO check if there is a nicer way to do this..
- self.rastlayername = "r_agent_rast_testmap"
- self.vectlayername = "r_agent_vect_testmap"
+ self.rastlayername = "r_agent_rast_testmap@"+grass.gisenv()['MAPSET']
+ self.vectlayername = "r_agent_vect_testmap@"+grass.gisenv()['MAPSET']
if self.rastlayername:
- for m in grass.list_grouped('rast')[grass.gisenv()['MAPSET']]:
+ for m in grass.list_strings('rast'):
if self.rastlayername == m:
print "We need a raster map to play with in this test," + \
" but it seems to exist already: '" + \
@@ -21,7 +21,7 @@
self.assertTrue(False)
if self.vectlayername:
- for m in grass.list_grouped('vect')[grass.gisenv()['MAPSET']]:
+ for m in grass.list_strings('vect'):
if self.vectlayername == m:
print "We need a vector map to play with in this test," + \
" but it seems to exist already: '" + \
More information about the grass-commit
mailing list