[GRASS-SVN] r55555 - grass-addons/grass7/raster/r.agent/libagent
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Mar 27 08:18:58 PDT 2013
Author: mic
Date: 2013-03-27 08:18:58 -0700 (Wed, 27 Mar 2013)
New Revision: 55555
Modified:
grass-addons/grass7/raster/r.agent/libagent/grassland.py
Log:
add test for map existence
Modified: grass-addons/grass7/raster/r.agent/libagent/grassland.py
===================================================================
--- grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-03-27 15:15:50 UTC (rev 55554)
+++ grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-03-27 15:18:58 UTC (rev 55555)
@@ -34,9 +34,10 @@
"""
layer = garray.array()
# fill the new grass array with the contents from the file
- layer.read(grassmapname)
- self.grassmapnames[layername] = grassmapname
- self.setlayer(layername, layer, force)
+ if grassmapname in grass.list_grouped('rast')[grass.gisenv()['MAPSET']]:
+ layer.read(grassmapname)
+ self.grassmapnames[layername] = grassmapname
+ self.setlayer(layername, layer, force)
def createlayer(self, layername, grassmapname=False, force=False):
"""
More information about the grass-commit
mailing list