[GRASS-SVN] r70462 - grass/trunk/scripts/d.polar

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 30 18:55:25 PST 2017


Author: wenzeslaus
Date: 2017-01-30 18:55:25 -0800 (Mon, 30 Jan 2017)
New Revision: 70462

Modified:
   grass/trunk/scripts/d.polar/d.polar.py
Log:
d.polar: fail fast if map does not exist

Modified: grass/trunk/scripts/d.polar/d.polar.py
===================================================================
--- grass/trunk/scripts/d.polar/d.polar.py	2017-01-30 23:46:38 UTC (rev 70461)
+++ grass/trunk/scripts/d.polar/d.polar.py	2017-01-31 02:55:25 UTC (rev 70462)
@@ -53,6 +53,11 @@
 from grass.script import core as gcore
 
 
+def raster_map_required(name):
+    if not gcore.find_file(name, 'cell')['file']:
+        gcore.fatal(_("Raster map <%s> not found") % name)
+
+
 def cleanup():
     try_remove(tmp)
     for f in glob.glob(tmp + '_*'):
@@ -418,6 +423,8 @@
         gcore.fatal(
             _("xgraph required, please install first (www.xgraph.org)"))
 
+    raster_map_required(map)
+
     #################################
     # this file contains everything:
     rawfile = tmp + "_raw"



More information about the grass-commit mailing list