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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 30 08:10:49 EDT 2010


Author: martinl
Date: 2010-05-30 08:10:48 -0400 (Sun, 30 May 2010)
New Revision: 42396

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix d.vect for more layers
(merge r42395 from devbr6)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-05-30 12:08:01 UTC (rev 42395)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-05-30 12:10:48 UTC (rev 42396)
@@ -192,7 +192,7 @@
         if not p or \
                 not p.has_key('wxId-bind'):
             return
-
+        
         # get widget prompt
         pType = p.get('prompt', '')
         if not pType:
@@ -200,6 +200,7 @@
         
         # check for map/input parameter
         pMap = self.task.get_param('map', raiseError=False)
+        
         if not pMap:
             pMap = self.task.get_param('input', raiseError=False)
 
@@ -1513,10 +1514,10 @@
             pMap['wxId-bind'] = copy.copy(pColumnIds)
             if pLayer:
                 pMap['wxId-bind'] += pLayerIds
+        if pLayer:
+            for p in pLayer:
+                p['wxId-bind'] = copy.copy(pColumnIds)
         
-        for p in pLayer:
-            p['wxId-bind'] = copy.copy(pColumnIds)
-
         if pDriver and pTable:
             pDriver['wxId-bind'] = pTable['wxId']
 

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2010-05-30 12:08:01 UTC (rev 42395)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2010-05-30 12:10:48 UTC (rev 42396)
@@ -286,22 +286,24 @@
     if not vector:
         return layers
     
-    ret = gcmd.RunCommand('v.category',
+    ret = gcmd.RunCommand('v.db.connect',
                           flags = 'g',
                           read = True,
-                          input = vector,
-                          option = 'report')
-    
+                          map = vector,
+                          fs = ';')
+        
     if not ret:
         return layers
     
     for line in ret.splitlines():
         try:
-            layer = line.split(' ')[0]
-            if layer not in layers:
-                layers.append(layer)
-        except ValueError:
+            layer = line.split(';')[0]
+            if '/' in layer:
+                layer = layer.split('/')[0]
+            layers.append(layer)
+        except IndexError:
             pass
+    
     Debug.msg(3, "utils.GetVectorNumberOfLayers(): vector=%s -> %s" % \
                   (vector, ','.join(layers)))
     



More information about the grass-commit mailing list