[GRASS-SVN] r55558 - grass-addons/grass7/raster/r.agent/libagent
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Mar 27 08:41:18 PDT 2013
Author: mic
Date: 2013-03-27 08:41:18 -0700 (Wed, 27 Mar 2013)
New Revision: 55558
Modified:
grass-addons/grass7/raster/r.agent/libagent/grassland.py
Log:
fix writelayer for grass map name
Modified: grass-addons/grass7/raster/r.agent/libagent/grassland.py
===================================================================
--- grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-03-27 15:30:34 UTC (rev 55557)
+++ grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-03-27 15:41:18 UTC (rev 55558)
@@ -68,11 +68,16 @@
"""
Write out a given layer to a GRASS map file
@param string name of the layer to be exported
- @param string optional name of the GRASS map file to be created
+ @param string optional name of the GRASS map file to be written
@param boolean optional, whether an existing file may be overwritten
"""
- if self.layers.has_key(layername) and \
- self.grassmapnames.has_key(layername):
+ if not grassmapname:
+ if self.grassmapnames.has_key(layername):
+ grassmapname=layername
+ else:
+ raise error.DataError("r.agent::libagent.grassland.Grassland()",
+ "Grass Map name is empty.")
+ if self.layers.has_key(layername):
if force:
force="force"
self.layers[layername].write(self.grassmapnames[layername],
More information about the grass-commit
mailing list