[GRASS-SVN] r54652 - grass-addons/grass7/raster/r.agent/libagent
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jan 15 15:09:11 PST 2013
Author: mic
Date: 2013-01-15 15:09:11 -0800 (Tue, 15 Jan 2013)
New Revision: 54652
Modified:
grass-addons/grass7/raster/r.agent/libagent/grassland.py
Log:
add an empty layer
Modified: grass-addons/grass7/raster/r.agent/libagent/grassland.py
===================================================================
--- grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-01-15 23:02:51 UTC (rev 54651)
+++ grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-01-15 23:09:11 UTC (rev 54652)
@@ -55,16 +55,17 @@
@param boolean optional, whether to overwrite values if key exists
"""
layer = garray.array()
- # fill the new grass array with the contents from the file
- layer.read(grassmapname)
+ if grassmapname:
+ # fill the new grass array with the contents from the file
+ layer.read(grassmapname)
self.setlayer(layername, layer, force)
- def createlayer(self, layername, grassmapname=False):
+ def createlayer(self, layername, force=False):
"""
Create a new layer and add it to the layer collection
@param string name of the layer
@param string name of a GRASS map layer or False if layer is only local
"""
- pass
+ self.setgrasslayer(layername, False, force)
def getlayer(self, layername):
"""
Return a layer from the collection by its name
More information about the grass-commit
mailing list