[GRASS-SVN] r32898 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 19 14:51:32 EDT 2008


Author: martinl
Date: 2008-08-19 14:51:31 -0400 (Tue, 19 Aug 2008)
New Revision: 32898

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
Log:
wxGUI: don't crash when no vector is in the current mapset

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py	2008-08-19 17:18:44 UTC (rev 32897)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gdialogs.py	2008-08-19 18:51:31 UTC (rev 32898)
@@ -128,8 +128,13 @@
         
         cmd.append("%s=%s" % (cmdDef[1], outmap))
         
+        try:
+            listOfVector = grass.list_grouped('vect')[grass.gisenv()['MAPSET']]
+        except KeyError:
+            listOfVectors = []
+        
         if not UserSettings.Get(group='cmd', key='overwrite', subkey='enabled') and \
-                outmap in grass.list_grouped('vect')[grass.gisenv()['MAPSET']]:
+                outmap in listOfVectors:
             dlg = wx.MessageDialog(parent, message=_("Vector map <%s> already exists "
                                                      "in the current mapset. "
                                                      "Do you want to overwrite it?") % outmap,



More information about the grass-commit mailing list