[GRASS-SVN] r32201 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jul 22 02:40:30 EDT 2008
Author: cmbarton
Date: 2008-07-22 02:40:29 -0400 (Tue, 22 Jul 2008)
New Revision: 32201
Modified:
grass/trunk/gui/wxpython/gui_modules/gselect.py
Log:
Used new grass library for mapset selection and element list parsing. Makes map selection much faster.
NOTE: This change CANNOT be backported to GRASS 6.4 unless the new grass python library and new init.sh code is also backported.
Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py 2008-07-21 22:52:43 UTC (rev 32200)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py 2008-07-22 06:40:29 UTC (rev 32201)
@@ -21,6 +21,7 @@
import wx
import wx.combo
+import grass
import globalvar
import gcmd
import utils
@@ -131,8 +132,7 @@
with all relevant elements displayed beneath each mapset branch
"""
# get current mapset
- cmdlist = ['g.gisenv', 'get=MAPSET']
- curr_mapset = gcmd.Command(cmdlist).ReadStdOutput()[0]
+ curr_mapset = grass.gisenv()['MAPSET']
# list of mapsets in current location
if mapsets is None:
@@ -195,12 +195,13 @@
mapsets[i] = mapsets[0]
mapsets[0] = curr_mapset
+ filesdict = grass.list_grouped(elementdict[element])
+
for dir in mapsets:
dir_node = self.AddItem('Mapset: '+dir)
self.seltree.SetItemTextColour(dir_node,wx.Colour(50,50,200))
try:
- cmdlist = ['g.mlist', 'type=%s' % elementdict[element], 'mapset=%s' % dir]
- elem_list = gcmd.Command(cmdlist).ReadStdOutput()
+ elem_list = filesdict[dir]
elem_list.sort()
for elem in elem_list:
if elem != '':
More information about the grass-commit
mailing list