[GRASS-SVN] r54851 - grass-addons/grass7/raster/r.agent

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 2 13:20:32 PST 2013


Author: mic
Date: 2013-02-02 13:20:32 -0800 (Sat, 02 Feb 2013)
New Revision: 54851

Modified:
   grass-addons/grass7/raster/r.agent/r.agent.aco
Log:
add environement feedback for enduser

Modified: grass-addons/grass7/raster/r.agent/r.agent.aco
===================================================================
--- grass-addons/grass7/raster/r.agent/r.agent.aco	2013-02-02 21:06:11 UTC (rev 54850)
+++ grass-addons/grass7/raster/r.agent/r.agent.aco	2013-02-02 21:20:32 UTC (rev 54851)
@@ -200,10 +200,13 @@
 #%end
 
 import sys
-from grass.script import core as grass
-
 from libagent import error, aco
 
+try:
+    from grass.script import core as grass
+except ImportError:
+    raise error.EnvError("r.agent.aco:", "Please run inside GRASS.")
+
 def main():
     world = aco.ACO()
 



More information about the grass-commit mailing list