[GRASS-SVN] r71306 - grass/trunk/gui/wxpython/location_wizard

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jul 22 10:46:54 PDT 2017


Author: wenzeslaus
Date: 2017-07-22 10:46:54 -0700 (Sat, 22 Jul 2017)
New Revision: 71306

Modified:
   grass/trunk/gui/wxpython/location_wizard/wizard.py
Log:
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).


Modified: grass/trunk/gui/wxpython/location_wizard/wizard.py
===================================================================
--- grass/trunk/gui/wxpython/location_wizard/wizard.py	2017-07-22 16:56:24 UTC (rev 71305)
+++ grass/trunk/gui/wxpython/location_wizard/wizard.py	2017-07-22 17:46:54 UTC (rev 71306)
@@ -2566,7 +2566,13 @@
             # 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',



More information about the grass-commit mailing list