[GRASS-SVN] r67427 - grass/branches/releasebranch_7_0/gui/wxpython/tplot
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Dec 30 06:21:47 PST 2015
Author: lucadelu
Date: 2015-12-30 06:21:47 -0800 (Wed, 30 Dec 2015)
New Revision: 67427
Modified:
grass/branches/releasebranch_7_0/gui/wxpython/tplot/frame.py
Log:
g.gui.tplot: fixed bugs when coordinates are missing or not in the right region (trunk r67424)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/tplot/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/tplot/frame.py 2015-12-30 13:01:52 UTC (rev 67426)
+++ grass/branches/releasebranch_7_0/gui/wxpython/tplot/frame.py 2015-12-30 14:21:47 UTC (rev 67427)
@@ -544,6 +544,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()
@@ -578,6 +583,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()
@@ -610,6 +620,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()
@@ -663,6 +678,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(',')
@@ -674,7 +693,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