[GRASS-SVN] r73440 - grass/trunk/lib/python/temporal

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 27 13:26:12 PDT 2018


Author: lucadelu
Date: 2018-09-27 13:26:12 -0700 (Thu, 27 Sep 2018)
New Revision: 73440

Modified:
   grass/trunk/lib/python/temporal/list_stds.py
Log:
temporal lib: add error message if the are no maps in the request, see #2268

Modified: grass/trunk/lib/python/temporal/list_stds.py
===================================================================
--- grass/trunk/lib/python/temporal/list_stds.py	2018-09-27 19:15:58 UTC (rev 73439)
+++ grass/trunk/lib/python/temporal/list_stds.py	2018-09-27 20:26:12 UTC (rev 73440)
@@ -25,6 +25,7 @@
 from .space_time_datasets import RasterDataset
 from .factory import dataset_factory
 from .open_stds import open_old_stds
+import grass.script as gscript
 
 ###############################################################################
 
@@ -254,6 +255,15 @@
                 columns = "id"
 
         rows = sp.get_registered_maps(columns, where, order, dbif)
+        
+        if not rows:
+            dbif.close()
+            err = "Space time %(sp)s dataset <%(i)s> is empty"
+            if where:
+                err += " or where condition is wrong"
+            gscript.fatal(_(err) % {
+                            'sp': sp.get_new_map_instance(None).get_type(),
+                            'i': sp.get_id()})
 
         if rows:
             if method == "comma":



More information about the grass-commit mailing list