Browse Source

wxGUI/catalog: fix crashing when mapset has space in name

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68258 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 9 years ago
parent
commit
ae4452fdf9
1 changed files with 3 additions and 3 deletions
  1. 3 3
      gui/wxpython/datacatalog/tree.py

+ 3 - 3
gui/wxpython/datacatalog/tree.py

@@ -61,13 +61,13 @@ def getLocationTree(gisdbase, location, queue, mapsets=None):
     elements = ['raster', 'raster_3d', 'vector']
     try:
         if not mapsets:
-            mapsets = gscript.read_command('g.mapsets', flags='l', quiet=True, env=env).strip()
+            mapsets = gscript.read_command('g.mapsets', flags='l', separator='comma', quiet=True, env=env).strip()
     except CalledModuleError:
         queue.put((maps_dict, _("Failed to read mapsets from location <{l}>.").format(l=location)))
         gscript.try_remove(tmp_gisrc_file)
         return
     else:
-        listOfMapsets = mapsets.split()
+        listOfMapsets = mapsets.split(',')
         Debug.msg(4, "Location <{}>: {} mapsets found".format(location, len(listOfMapsets)))
         for each in listOfMapsets:
             maps_dict[each] = {}
@@ -249,7 +249,7 @@ class LocationMapTree(TreeView):
                 location_nodes = []
 
         if errors:
-            GWarning('\n'.join(errors))
+            wx.CallAfter(GWarning, '\n'.join(errors))
         Debug.msg(1, "Tree filled")
         self.RefreshItems()