[GRASS-SVN] r35771 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 5 03:56:31 EST 2009
Author: martinl
Date: 2009-02-05 03:56:31 -0500 (Thu, 05 Feb 2009)
New Revision: 35771
Modified:
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
Log:
wxGUI: fix layer querying
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2009-02-05 08:51:07 UTC (rev 35770)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2009-02-05 08:56:31 UTC (rev 35771)
@@ -1101,8 +1101,8 @@
mapname = None
raststr = ''
vectstr = ''
- rcmd = ['r.what', { 'quiet' : True }]
- vcmd = ['v.what', { 'quiet' : True }]
+ rcmd = ['r.what', '--q']
+ vcmd = ['v.what', '--q']
for layer in self.tree.GetSelections():
type = self.tree.GetPyData(layer)[0]['maplayer'].type
dcmd = self.tree.GetPyData(layer)[0]['cmd']
@@ -1120,9 +1120,9 @@
# build query commands for any selected rasters and vectors
if raststr != '':
- rcmd[1]['flags'] = 'f'
- rcmd[1]['input'] = raststr.rstrip(',')
- rcmd[1]['east_north'] = '%f,%f' % (float(east), float(north))
+ rcmd.append('-f')
+ rcmd.append('input=%s' % raststr.rstrip(','))
+ rcmd.append('east_north=%f,%f' % (float(east), float(north)))
if vectstr != '':
# check for vector maps open to be edited
@@ -1142,24 +1142,22 @@
self.gismanager.goutput.WriteCmdLog("Nothing to query.")
return
- vcmd[1]['flags'] = 'a'
- vcmd[1]['map'] = vectstr.rstrip(',')
- vcmd[1]['east_north'] = '%f,%f' % (float(east), float(north)),
- vcmd[1]['distance'] = qdist
+ vcmd.append('-a')
+ vcmd.append('map=%s' % vectstr.rstrip(','))
+ vcmd.append('east_north=%f,%f' % (float(east), float(north)))
+ vcmd.append('distance=%f' % float(qdist))
# parse query command(s)
if self.gismanager:
- if rcmd:
- self.gismanager.goutput.RunCmd(prog = rcmd[0],
- compReg=False,
- **rcmd[1])
- if vcmd:
- self.gismanager.goutput.RunCmd(prog = vcmd[0],
- **vcmd)
+ if raststr:
+ self.gismanager.goutput.RunCmd(rcmd,
+ compReg=False)
+ if vectstr:
+ self.gismanager.goutput.RunCmd(vcmd)
else:
- if rcmd:
+ if raststr:
gcmd.RunCommand(rcmd)
- if vcmd:
+ if vectstr:
gcmd.RunCommand(vcmd)
# restore GRASS_REGION
More information about the grass-commit
mailing list