[GRASS-SVN] r55138 - in grass/branches/releasebranch_6_4/gui/wxpython: core gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 21 01:42:00 PST 2013


Author: annakrat
Date: 2013-02-21 01:42:00 -0800 (Thu, 21 Feb 2013)
New Revision: 55138

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/core/utils.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/gselect.py
Log:
wxGUI: revert 55137

Modified: grass/branches/releasebranch_6_4/gui/wxpython/core/utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/core/utils.py	2013-02-20 23:10:57 UTC (rev 55137)
+++ grass/branches/releasebranch_6_4/gui/wxpython/core/utils.py	2013-02-21 09:42:00 UTC (rev 55138)
@@ -331,51 +331,6 @@
     
     return layers
 
-def GetAllVectorLayers(vector):
-    """!Returns list of all vector layers as strings.
-
-    @param vector name of vector map
-    """
-    layers = []
-    if not vector:
-        return layers
-    
-    fullname = grass.find_file(name = vector, element = 'vector')['fullname']
-    if not fullname:
-        Debug.msg(3, "utils.GetAllVectorLayers(): vector map <%s> not found" % vector)
-        return layers
-    
-    ret, out, msg = RunCommand('v.category',
-                               getErrorMsg = True,
-                               read = True,
-                               quiet = True,
-                               option = 'report',
-                               flags = 'g',
-                               input = fullname)
-    print out
-    if ret != 0:
-        sys.stderr.write(_("Vector map <%(map)s>: %(msg)s\n") % { 'map' : fullname, 'msg' : msg })
-        return layers
-    
-    Debug.msg(1, "utils.GetAllVectorLayers(): ret %s" % ret)
-
-    for line in out.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)
-
-    Debug.msg(3, "utils.GetAllVectorLayers(): vector=%s -> %s" % \
-                  (fullname, ','.join(layers)))
-
-    return layers
-
 def Deg2DMS(lon, lat, string = True, hemisphere = True, precision = 3):
     """!Convert deg value to dms string
 

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/gselect.py	2013-02-20 23:10:57 UTC (rev 55137)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/gselect.py	2013-02-21 09:42:00 UTC (rev 55138)
@@ -48,7 +48,7 @@
 
 from core.gcmd     import RunCommand, GError, GMessage
 from core.utils    import GetListOfLocations, GetListOfMapsets, GetFormats
-from core.utils    import GetSettingsPath, GetValidLayerName, ListSortLower, GetAllVectorLayers
+from core.utils    import GetSettingsPath, GetValidLayerName, ListSortLower, GetVectorNumberOfLayers
 from core.settings import UserSettings
 from core.debug    import Debug
 
@@ -681,7 +681,7 @@
         @param vector name of vector map
         """
         if vector:
-            layers = GetAllVectorLayers(vector)
+            layers = GetVectorNumberOfLayers(vector)
         else:
             layers = list()
         



More information about the grass-commit mailing list