[GRASS-SVN] r49432 - grass/trunk/gui/wxpython/wxplot
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Nov 30 06:26:38 EST 2011
Author: martinl
Date: 2011-11-30 03:26:38 -0800 (Wed, 30 Nov 2011)
New Revision: 49432
Modified:
grass/trunk/gui/wxpython/wxplot/base.py
grass/trunk/gui/wxpython/wxplot/histogram.py
grass/trunk/gui/wxpython/wxplot/scatter.py
Log:
wxGUI: fix wxplot modules (after major code reorganization)
Modified: grass/trunk/gui/wxpython/wxplot/base.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/base.py 2011-11-30 11:11:59 UTC (rev 49431)
+++ grass/trunk/gui/wxpython/wxplot/base.py 2011-11-30 11:26:38 UTC (rev 49432)
@@ -167,11 +167,11 @@
except:
continue
# if r.info cannot parse map, skip it
-
+
self.raster[r] = UserSettings.Get(group = plottype, key = 'raster') # some default settings
rdict[r] = {} # initialize sub-dictionaries for each raster in the list
-
- if ret['units'] == '(none)' or ret['units'] == '' or ret['units'] == None:
+
+ if ret['units'] in ('(none)', '"none"', '', None):
rdict[r]['units'] = ''
else:
self.raster[r]['units'] = ret['units']
Modified: grass/trunk/gui/wxpython/wxplot/histogram.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/histogram.py 2011-11-30 11:11:59 UTC (rev 49431)
+++ grass/trunk/gui/wxpython/wxplot/histogram.py 2011-11-30 11:26:38 UTC (rev 49432)
@@ -26,6 +26,7 @@
from wxplot.base import BasePlotFrame
from icons.icon import Icons
from wxplot.dialogs import HistRasterDialog, PlotStatsFrame
+from core.gcmd import RunCommand, GException, GError
class Histogram2Frame(BasePlotFrame):
def __init__(self, parent, id, pos, style, size, rasterList = []):
@@ -141,14 +142,14 @@
if self.histtype == 'area': freqflag = 'an'
try:
- ret = gcmd.RunCommand("r.stats",
- parent = self,
- input = raster,
- flags = freqflag,
- nsteps = self.bins,
- fs = ',',
- quiet = True,
- read = True)
+ ret = RunCommand("r.stats",
+ parent = self,
+ input = raster,
+ flags = freqflag,
+ nsteps = self.bins,
+ fs = ',',
+ quiet = True,
+ read = True)
if not ret:
return datalist
@@ -164,9 +165,9 @@
datalist.append((cellval,histval))
return datalist
- except gcmd.GException, e:
- gcmd.GError(parent = self,
- message = e.value)
+ except GException, e:
+ GError(parent = self,
+ message = e.value)
return None
def CreatePlotList(self):
Modified: grass/trunk/gui/wxpython/wxplot/scatter.py
===================================================================
--- grass/trunk/gui/wxpython/wxplot/scatter.py 2011-11-30 11:11:59 UTC (rev 49431)
+++ grass/trunk/gui/wxpython/wxplot/scatter.py 2011-11-30 11:26:38 UTC (rev 49432)
@@ -26,6 +26,7 @@
from gui_core.toolbars import BaseToolbar
from icons.icon import Icons
from wxplot.dialogs import ScatterRasterDialog, PlotStatsFrame
+from core.gcmd import RunCommand, GException, GError
class ScatterFrame(BasePlotFrame):
"""!Mainframe for displaying bivariate scatter plot of two raster maps. Uses wx.lib.plot.
@@ -163,14 +164,14 @@
freqflag = 'n'
try:
- ret = gcmd.RunCommand("r.stats",
- parent = self,
- input = '%s,%s' % rpair,
- flags = freqflag,
- nsteps = self.bins,
- fs = ',',
- quiet = True,
- read = True)
+ ret = RunCommand("r.stats",
+ parent = self,
+ input = '%s,%s' % rpair,
+ flags = freqflag,
+ nsteps = self.bins,
+ fs = ',',
+ quiet = True,
+ read = True)
if not ret:
return datalist
@@ -188,9 +189,9 @@
datalist.append((rast1,rast2))
return datalist
- except gcmd.GException, e:
- gcmd.GError(parent = self,
- message = e.value)
+ except GException, e:
+ GError(parent = self,
+ message = e.value)
return None
def CreatePlotList(self):
More information about the grass-commit
mailing list