[GRASS-SVN] r55942 - in grass/trunk/gui/wxpython: core gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 22 03:24:27 PDT 2013


Author: mmetz
Date: 2013-04-22 03:24:26 -0700 (Mon, 22 Apr 2013)
New Revision: 55942

Modified:
   grass/trunk/gui/wxpython/core/utils.py
   grass/trunk/gui/wxpython/gui_core/gselect.py
Log:
wxGUI: fix and use fast v.category option

Modified: grass/trunk/gui/wxpython/core/utils.py
===================================================================
--- grass/trunk/gui/wxpython/core/utils.py	2013-04-22 04:45:52 UTC (rev 55941)
+++ grass/trunk/gui/wxpython/core/utils.py	2013-04-22 10:24:26 UTC (rev 55942)
@@ -310,8 +310,7 @@
                                getErrorMsg = True,
                                read = True,
                                input = fullname,
-                               option = 'layers',
-                               sep = ';')
+                               option = 'layers')
     if ret != 0:
         sys.stderr.write(_("Vector map <%(map)s>: %(msg)s\n") % { 'map' : fullname, 'msg' : msg })
         return layers

Modified: grass/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py	2013-04-22 04:45:52 UTC (rev 55941)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py	2013-04-22 10:24:26 UTC (rev 55942)
@@ -58,6 +58,7 @@
 from core.gcmd     import RunCommand, GError, GMessage
 from core.utils    import GetListOfLocations, GetListOfMapsets, GetFormats
 from core.utils    import GetSettingsPath, GetValidLayerName, ListSortLower
+from core.utils    import GetVectorNumberOfLayers
 from core.settings import UserSettings
 from core.debug    import Debug
 
@@ -815,24 +816,7 @@
             layers.append('-1')
 
         if vector:
-            ret = RunCommand('v.category',
-                             read = True,
-                             quiet = True,
-                             option = 'report',
-                             flags = 'g',
-                             input = vector)
-            if ret:
-                for line in ret.splitlines():
-                    if 'all' not in line:
-                        continue
-                    try:
-                        layer = line.split(' ')[0]
-                    except IndexError:
-                        continue
-                    # use this to get layer names
-                    # but only when all modules use Vect_get_field2()
-                    # which is not the case right now
-                    layers.append(layer)
+	    layers = GetVectorNumberOfLayers(vector)
 
         elif dsn:
             ret = RunCommand('v.in.ogr',



More information about the grass-commit mailing list