Browse Source

wxGUI/datacatalog: fix failure when mapsets are not readable

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64236 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 years ago
parent
commit
8f2d3909be
1 changed files with 8 additions and 3 deletions
  1. 8 3
      gui/wxpython/lmgr/datacatalog.py

+ 8 - 3
gui/wxpython/lmgr/datacatalog.py

@@ -117,9 +117,14 @@ class LocationMapTree(wx.TreeCtrl):
             
             varloc = self.AppendItem(self.root, loc)
             # add all mapsets
-            for mapset in ListOfMapsets():
-                self.AppendItem(varloc, mapset)
-            
+            mapsets = ListOfMapsets()
+            if mapsets:
+                for mapset in mapsets:
+                    self.AppendItem(varloc, mapset)
+            else:
+                self.AppendItem(varloc, _("No mapsets readable"))
+                continue
+
             # get list of all maps in location
             maplist = RunCommand('g.list', flags='mt', type='raster,raster_3d,vector', mapset=','.join(mapsets),
                                  quiet=True, read=True)