[GRASS-SVN] r55978 - grass-addons/grass7/raster/r.agent/libagent
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Apr 24 04:27:52 PDT 2013
Author: mic
Date: 2013-04-24 04:27:52 -0700 (Wed, 24 Apr 2013)
New Revision: 55978
Modified:
grass-addons/grass7/raster/r.agent/libagent/grassland.py
Log:
use a class key
Modified: grass-addons/grass7/raster/r.agent/libagent/grassland.py
===================================================================
--- grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-04-24 11:05:52 UTC (rev 55977)
+++ grass-addons/grass7/raster/r.agent/libagent/grassland.py 2013-04-24 11:27:52 UTC (rev 55978)
@@ -16,13 +16,16 @@
class Grassland(playground.Playground):
"""A GrassLand is a Playground and the interface to GRASS."""
+ # internal logging class name
+ ME = "r.agent::libagent.grassland.Grassland()"
+
def __init__(self):
"""Create a Playground with all the relevant info by GRASS"""
self.layers = dict()
self.grassmapnames = dict()
self.region = grass.region()
if self.region['ewres'] != self.region['nsres']:
- raise error.DataError("r.agent::libagent.grassland.Grassland()",
+ raise error.DataError(Grassland.ME,
"Only square raster cells make sense.")
def setgrasslayer(self, layername, grassmapname, force=False):
@@ -39,7 +42,7 @@
self.grassmapnames[layername] = grassmapname
self.setlayer(layername, layer, force)
else:
- raise error.DataError("r.agent::libagent.grassland.Grassland()",
+ raise error.DataError(Grassland.ME,
"Grass Map was missing: " + grassmapname)
def createlayer(self, layername, grassmapname=False, force=False):
@@ -75,7 +78,7 @@
if self.grassmapnames.has_key(layername):
grassmapname=layername
else:
- raise error.DataError("r.agent::libagent.grassland.Grassland()",
+ raise error.DataError(Grassland.ME,
"Grass Map name is empty.")
if self.layers.has_key(layername):
if grassmapname in \
@@ -83,9 +86,8 @@
if force:
force="force"
else:
- raise error.DataError(
- "r.agent::libagent.grassland.Grassland()",
- "Grass map already exists.")
+ raise error.DataError(Grassland.ME,
+ "Grass map already exists.")
self.layers[layername].write(grassmapname, overwrite=force)
def parsevectorlayer(self, layername, grassmapname, value=1, force=False):
More information about the grass-commit
mailing list