[GRASS-SVN] r48738 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 11 13:02:59 EDT 2011


Author: martinl
Date: 2011-10-11 10:02:59 -0700 (Tue, 11 Oct 2011)
New Revision: 48738

Modified:
   grass/trunk/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: fix fully-qualified names (translated 'mapset' can contain spaces)


Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py	2011-10-11 16:27:55 UTC (rev 48737)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py	2011-10-11 17:02:59 UTC (rev 48738)
@@ -405,7 +405,7 @@
                 item = self.FindItem(item, text, startLetters = startletters)
                 if wx.TreeItemId.IsOk(item):
                     return item
-            elif startletters and self.seltree.GetItemText(item).startswith(text.split('@')[0]):
+            elif startletters and self.seltree.GetItemText(item).startswith(text.split('@', 1)[0]):
                 return item
             item, cookie = self.seltree.GetNextChild(parentItem, cookie)
         return wx.TreeItemId()
@@ -471,8 +471,9 @@
                 self.value = [] 
             else:
                 mapsetItem = self.seltree.GetItemParent(item)
-                fullName = self.seltree.GetItemText(item) + '@' \
-                            + self.seltree.GetItemText(mapsetItem).split(' ', 1)[1]
+                fullName = self.seltree.GetItemText(item) + '@' + \
+                    self.seltree.GetItemText(mapsetItem).split(':', -1)[1].strip()
+                
                 if self.multiple is True:
                     # text item should be unique
                     self.value.append(fullName)
@@ -502,7 +503,7 @@
             else:
                 mapsetItem = self.seltree.GetItemParent(item)
                 fullName = self.seltree.GetItemText(item) + '@' + \
-                    self.seltree.GetItemText(mapsetItem).split(' ', 1)[1]
+                    self.seltree.GetItemText(mapsetItem).split(':', -1)[1].strip()
                 
                 if self.multiple is True:
                     # text item should be unique



More information about the grass-commit mailing list