[GRASS-SVN] r45032 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 14 15:06:10 EST 2011


Author: martinl
Date: 2011-01-14 12:06:10 -0800 (Fri, 14 Jan 2011)
New Revision: 45032

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: check if vector exists
(merge r45030 from trunk)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2011-01-14 20:04:24 UTC (rev 45031)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2011-01-14 20:06:10 UTC (rev 45032)
@@ -225,7 +225,7 @@
             name = win.GetName()
             
             if name == 'LayerSelect':
-                if not cparams[map]['layers']:
+                if cparams.has_key(map) and not cparams[map]['layers']:
                     win.InsertLayers(vector = map)
                     cparams[map]['layers'] = win.GetItems()
             
@@ -252,13 +252,11 @@
                     layer = 1
                 
                 if map:
-                    try:
+                    if cparams.has_key(map):
                         if not cparams[map]['dbInfo']:
                             cparams[map]['dbInfo'] = gselect.VectorDBInfo(map)
                         self.data[win.InsertColumns] = { 'vector' : map, 'layer' : layer,
                                                          'dbInfo' : cparams[map]['dbInfo'] }
-                    except KeyError:
-                        pass
                 else: # table
                     driver = db = None
                     pDriver = self.task.get_param('dbdriver', element='prompt', raiseError=False)



More information about the grass-commit mailing list