Explorar o código

wxGUI/welcome: fix g.mapset output parsing
(merge https://trac.osgeo.org/grass/changeset/47247 from relbr64)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@47249 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa %!s(int64=13) %!d(string=hai) anos
pai
achega
6c5f39ce93
Modificáronse 1 ficheiros con 7 adicións e 10 borrados
  1. 7 10
      gui/wxpython/gis_set.py

+ 7 - 10
gui/wxpython/gis_set.py

@@ -592,19 +592,16 @@ class GRASSStartup(wx.Frame):
         # disable mapset with denied permission
         locationName = os.path.basename(location)
         
-        try:
-            ret = gcmd.RunCommand('g.mapset',
-                                  read = True,
-                                  flags = 'l',
-                                  location = locationName,
-                                  gisdbase = self.gisdbase)
-            
-            if ret == '':
-                GError(_("No mapsets available in location <%s>") % locationName)
+        ret = gcmd.RunCommand('g.mapset',
+                              read = True,
+                              flags = 'l',
+                              location = locationName,
+                              gisdbase = self.gisdbase)
             
+        if ret:
             for line in ret.splitlines():
                 self.listOfMapsetsSelectable += line.split(' ')
-        except:
+        else:
             gcmd.RunCommand("g.gisenv",
                             set = "GISDBASE=%s" % self.gisdbase)
             gcmd.RunCommand("g.gisenv",