[GRASS-SVN] r45238 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 28 09:39:55 EST 2011
Author: martinl
Date: 2011-01-28 06:39:55 -0800 (Fri, 28 Jan 2011)
New Revision: 45238
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/profile.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
Log:
wxGUI: fix adding legend/barscale from command prompt
(merge r45237 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -95,7 +95,7 @@
keyColumn = self.LoadData(layer)
except gcmd.GException, e:
GError(parent = self,
- message = e)
+ message = e.value)
return
#
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -289,7 +289,7 @@
**cmd[1])
except gcmd.GException, e:
gcmd.GError(parent = self,
- message = e)
+ message = e.value)
return (None, None)
#
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -474,27 +474,27 @@
'd.grid' : 'grid',
'd.geodesic' : 'geodesic',
'd.rhumbline' : 'rhumb',
- 'd.labels' : 'labels'}[command[0]]
+ 'd.labels' : 'labels',
+ 'd.barscale' : 'barscale'}[command[0]]
except KeyError:
gcmd.GMessage(parent = self.parent,
message = _("Command '%s' not yet implemented in the WxGUI. "
"Try adding it as a command layer instead.") % command[0])
return None
- # add layer into layer tree
- if command[0] == 'd.rast':
+ if layertype == 'barscale':
+ self.parent.curr_page.maptree.GetMapDisplay().OnAddBarscale(None)
+ elif layertype == 'rastleg':
+ self.parent.curr_page.maptree.GetMapDisplay().OnAddLegend(None)
+ else:
+ # add layer into layer tree
lname, found = utils.GetLayerNameFromCmd(command, fullyQualified = True,
- layerType = 'raster')
- elif command[0] == 'd.vect':
- lname, found = utils.GetLayerNameFromCmd(command, fullyQualified = True,
- layerType = 'vector')
- else:
- lname = None
+ layerType = layertype)
+ if self.parent.GetName() == "LayerManager":
+ self.parent.curr_page.maptree.AddLayer(ltype = layertype,
+ lname = lname,
+ lcmd = command)
- if self.parent.GetName() == "LayerManager":
- self.parent.curr_page.maptree.AddLayer(ltype=layertype,
- lname=lname,
- lcmd=command)
else:
# other GRASS commands (r|v|g|...)
# switch to 'Command output' if required
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/layertree.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -429,7 +429,8 @@
self.lmgr.goutput.RunCmd(cmd)
def OnSetCompRegFromMap(self, event):
- """!Set computational region from selected raster/vector map"""
+ """!Set computational region from selected raster/vector map
+ """
rast = []
vect = []
rast3d = []
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -1755,7 +1755,7 @@
"""
if self.dialogs['barscale']:
return
-
+
id = 0 # unique index for overlay layer
# If location is latlon, only display north arrow (scale won't work)
@@ -1770,7 +1770,7 @@
gdialogs.DecorationDialog(parent = self, title = _('Scale and North arrow'),
size = (350, 200),
style = wx.DEFAULT_DIALOG_STYLE | wx.CENTRE,
- cmd = ['d.barscale', 'at = 0,5'],
+ cmd = ['d.barscale', 'at=0,5'],
ovlId = id,
name = 'barscale',
checktxt = _("Show/hide scale and North arrow"),
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp_window.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -774,7 +774,7 @@
else:
self.mapfile = self.Map.Render(force = False, mapWindow = self.parent)
except gcmd.GException, e:
- gcmd.GError(message = e)
+ gcmd.GError(message = e.value)
self.mapfile = None
self.img = self.GetImage() # id=99
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -361,7 +361,7 @@
processTask(tree = etree.fromstring(getInterfaceDescription(grassModule)),
task = self)
except gcmd.GException, e:
- self.errorMsg = str(e)
+ self.errorMsg = e.value
self.define_first()
@@ -1967,7 +1967,7 @@
stderr = grass.PIPE).communicate()
except OSError, e:
raise gcmd.GException, _("Unable to fetch interface description for command '%s'. "
- "Details: %s") % (cmd, repr(e))
+ "Details: %s") % (cmd, e.value)
if cmderr and cmderr[:7] != 'WARNING':
raise gcmd.GException, _("Unable to fetch interface description for command '%s'. "
"Details: %s") % (cmd, cmderr)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/nviz_mapdisp.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -442,7 +442,7 @@
self.LoadVector(item, points = False)
except gcmd.GException, e:
GError(parent = self,
- message = e)
+ message = e.value)
self.init = False
stop = time.time()
@@ -481,7 +481,7 @@
self.UpdateView(None)
except gcmd.GException, e:
gcmd.GError(parent = self,
- message = e)
+ message = e.value)
self.lmgr.nviz.UpdateSettings()
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/profile.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/profile.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/profile.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -439,7 +439,7 @@
return datalist
except gcmd.GException, e:
gcmd.GError(parent = self,
- message = e)
+ message = e.value)
return None
def OnCreateProfile(self, event):
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py 2011-01-28 14:35:09 UTC (rev 45237)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py 2011-01-28 14:39:55 UTC (rev 45238)
@@ -125,7 +125,7 @@
layertypes = ('raster', 'rgb', 'his', 'shaded', 'rastarrow', 'rastnum',
'vector','thememap','themechart',
'grid', 'geodesic', 'rhumb', 'labels',
- 'command',
+ 'command', 'rastleg',
'overlay')
if self.type not in layertypes:
@@ -199,7 +199,7 @@
self.maskfile = None
except gcmd.GException, e:
- sys.stderr.write(e)
+ sys.stderr.write(e.value)
# clean up after problems
try:
os.remove(self.mapfile)
@@ -294,7 +294,7 @@
'shaded', 'rgb', 'his', 'rastarrow', 'rastnum',
'thememap', 'themechart', 'grid', 'labels',
'geodesic','rhumb'):
- raise gcmd.GException(_("Unsupported map layer type '%s'") % str(type))
+ raise gcmd.GException(_("Unsupported map layer type '%s'") % type)
self.type = type
@@ -983,7 +983,7 @@
Debug.msg (3, "Map.AddLayer(): layer=%s" % layer.name)
if l_render:
if not layer.Render():
- raise gcmd.GException(_("Unable to render map layer <%s>.") % (name))
+ raise gcmd.GException(_("Unable to render map layer <%s>.") % name)
return layer
@@ -1066,7 +1066,7 @@
if render and not layer.Render():
raise gcmd.GException(_("Unable to render map layer <%s>.") %
- (name))
+ name)
return layer
@@ -1175,7 +1175,7 @@
if l_render and command != '' and not overlay.Render():
raise gcmd.GException(_("Unable render overlay <%s>.") %
- (name))
+ name)
return self.overlays[-1]
@@ -1214,7 +1214,7 @@
if render and command != [] and not overlay.Render():
raise gcmd.GException(_("Unable render overlay <%s>") %
- (name))
+ name)
return overlay
More information about the grass-commit
mailing list