Browse Source

wxGUI: show error when creating db

Previously traceback went to command line.
Typical errors are Permission denied and No such file or dir
(mkdir creates only last item on the path).


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71306 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 8 năm trước cách đây
mục cha
commit
70f251e00d
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      gui/wxpython/location_wizard/wizard.py

+ 7 - 1
gui/wxpython/location_wizard/wizard.py

@@ -2566,7 +2566,13 @@ class LocationWizard(wx.Object):
             # change to new GISDbase or create new one
             if os.path.isdir(database) != True:
                 # create new directory
-                os.mkdir(database)
+                try:
+                    os.mkdir(database)
+                except OSError as error:
+                    GError(parent=self.wizard, message="%s <%s>" %
+                           (_("Unable to create new GRASS Database"),
+                           database))
+                    return None
 
             # change to new GISDbase directory
             RunCommand('g.gisenv',