[GRASS-SVN] r35772 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 5 03:59:36 EST 2009


Author: martinl
Date: 2009-02-05 03:59:36 -0500 (Thu, 05 Feb 2009)
New Revision: 35772

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
Log:
wxGUI: fix layer querying
       (merge from trunk, r35771)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2009-02-05 08:56:31 UTC (rev 35771)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2009-02-05 08:59:36 UTC (rev 35772)
@@ -1106,8 +1106,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']
@@ -1125,9 +1125,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
@@ -1147,24 +1147,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