[GRASS-SVN] r67424 - grass/trunk/gui/wxpython/tplot

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 30 01:11:32 PST 2015


Author: lucadelu
Date: 2015-12-30 01:11:32 -0800 (Wed, 30 Dec 2015)
New Revision: 67424

Modified:
   grass/trunk/gui/wxpython/tplot/frame.py
Log:
g.gui.tplot: fixed bugs when coordinates are missing or not in the right region

Modified: grass/trunk/gui/wxpython/tplot/frame.py
===================================================================
--- grass/trunk/gui/wxpython/tplot/frame.py	2015-12-29 19:52:49 UTC (rev 67423)
+++ grass/trunk/gui/wxpython/tplot/frame.py	2015-12-30 09:11:32 UTC (rev 67424)
@@ -545,6 +545,11 @@
                 xdata.append(self.convert(values['start_datetime']))
                 ydata.append(values['value'])
 
+            if len(ydata) == ydata.count(None):
+                GError(parent=self, showTraceback=False,
+                       message=_("Problem getting data from raster temporal"
+                                 " dataset. Empty list of values."))
+                return
             self.lookUp.AddDataset(yranges=ydata, xranges=xdata,
                                    datasetName=name)
             color = self.colors.next()
@@ -579,6 +584,11 @@
                 xdata.append(self.convert(values['start_datetime']))
                 ydata.append(values['value'])
 
+            if len(ydata) == ydata.count(None):
+                GError(parent=self, showTraceback=False,
+                       message=_("Problem getting data from raster temporal"
+                                 " dataset. Empty list of values."))
+                return
             self.lookUp.AddDataset(yranges=ydata, xranges=xdata,
                                    datasetName=name)
             color = self.colors.next()
@@ -611,6 +621,11 @@
                 xdata.append(self.convert(values['start_datetime']))
                 ydata.append(values['value'])
 
+            if len(ydata) == ydata.count(None):
+                GError(parent=self, showTraceback=False,
+                       message=_("Problem getting data from raster temporal"
+                                 " dataset. Empty list of values."))
+                return
             self.lookUp.AddDataset(yranges=ydata, xranges=xdata,
                                    datasetName=name)
             color = self.colors.next()
@@ -664,6 +679,10 @@
                     GError(parent=self, message=_("Invalid input coordinates"),
                            showTraceback=False)
                     return
+                if not self.poi:
+                    GError(parent=self, message=_("Invalid input coordinates"),
+                           showTraceback=False)
+                    return
         # check raster dataset
         if datasetsR:
             datasetsR = datasetsR.split(',')
@@ -675,7 +694,10 @@
                 GError(parent=self, message=_("Invalid input raster dataset"),
                        showTraceback=False)
                 return
-
+            if not self.poi:
+                GError(parent=self, message=_("Invalid input coordinates"),
+                       showTraceback=False)
+                return
             self.datasetsR = datasetsR
 
         # check vector dataset



More information about the grass-commit mailing list