[GRASS-SVN] r42397 -
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun May 30 08:13:25 EDT 2010
Author: martinl
Date: 2010-05-30 08:13:25 -0400 (Sun, 30 May 2010)
New Revision: 42397
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix d.vect for more layers
(merge r42395 from devbr6)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py 2010-05-30 12:10:48 UTC (rev 42396)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py 2010-05-30 12:13:25 UTC (rev 42397)
@@ -196,7 +196,7 @@
if not p or \
not p.has_key('wxId-bind'):
return
-
+
# get widget prompt
pType = p.get('prompt', '')
if not pType:
@@ -204,6 +204,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)
@@ -1568,10 +1569,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/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py 2010-05-30 12:10:48 UTC (rev 42396)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py 2010-05-30 12:13:25 UTC (rev 42397)
@@ -252,22 +252,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