[GRASS-SVN] r29507 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Dec 26 09:04:59 EST 2007
Author: martinl
Date: 2007-12-26 09:04:59 -0500 (Wed, 26 Dec 2007)
New Revision: 29507
Modified:
grass/trunk/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: Show elements from current mapset first
Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py 2007-12-26 13:48:53 UTC (rev 29506)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py 2007-12-26 14:04:59 UTC (rev 29507)
@@ -212,30 +212,24 @@
self.AddItem('Not selectable element')
return
- #Get directory tree nodes
+ # get directory tree nodes
+ # reorder mapsets based on search path (TODO)
+ for i in range(len(mapsets)):
+ if i > 0 and mapsets[i] == curr_mapset:
+ mapsets[i] = mapsets[0]
+ mapsets[0] = curr_mapset
for dir in mapsets:
- if dir == curr_mapset:
- 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.sort()
- for elem in elem_list:
- if elem != '': self.AddItem(elem+'@'+dir, parent=dir_node)
- except:
- continue
- else:
- 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.sort()
- for elem in elem_list:
- if elem != '': self.AddItem(elem+'@'+dir, parent=dir_node)
- except:
- continue
+ 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.sort()
+ for elem in elem_list:
+ if elem != '':
+ self.AddItem(elem+'@'+dir, parent=dir_node)
+ except:
+ continue
if self.seltree.ItemHasChildren(dir_node):
self.seltree.Expand(dir_node)
More information about the grass-commit
mailing list