[GRASS-SVN] r55140 - grass/trunk/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 21 02:13:02 PST 2013


Author: mmetz
Date: 2013-02-21 02:13:02 -0800 (Thu, 21 Feb 2013)
New Revision: 55140

Modified:
   grass/trunk/gui/wxpython/core/utils.py
Log:
wxGUI: GetVectorNumberOfLayers use v.category op=layers

Modified: grass/trunk/gui/wxpython/core/utils.py
===================================================================
--- grass/trunk/gui/wxpython/core/utils.py	2013-02-21 10:12:02 UTC (rev 55139)
+++ grass/trunk/gui/wxpython/core/utils.py	2013-02-21 10:13:02 UTC (rev 55140)
@@ -304,11 +304,11 @@
         Debug.msg(5, "utils.GetVectorNumberOfLayers(): vector map '%s' not found" % vector)
         return layers
     
-    ret, out, msg = RunCommand('v.db.connect',
+    ret, out, msg = RunCommand('v.category',
                                getErrorMsg = True,
                                read = True,
-                               flags = 'g',
-                               map = fullname,
+                               input = fullname,
+                               option = 'layers',
                                sep = ';')
     if ret != 0:
         sys.stderr.write(_("Vector map <%(map)s>: %(msg)s\n") % { 'map' : fullname, 'msg' : msg })
@@ -316,14 +316,8 @@
     else:
         Debug.msg(1, "GetVectorNumberOfLayers(): ret %s" % ret)
     
-    for line in out.splitlines():
-        try:
-            layer = line.split(';')[0]
-            if '/' in layer:
-                layer = layer.split('/')[0]
-            layers.append(layer)
-        except IndexError:
-            pass
+    for layer in out.splitlines():
+        layers.append(layer)
     
     Debug.msg(3, "utils.GetVectorNumberOfLayers(): vector=%s -> %s" % \
                   (fullname, ','.join(layers)))



More information about the grass-commit mailing list