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

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 14 15:04:24 EST 2011


Author: martinl
Date: 2011-01-14 12:04:24 -0800 (Fri, 14 Jan 2011)
New Revision: 45031

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


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-01-14 20:02:43 UTC (rev 45030)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2011-01-14 20:04:24 UTC (rev 45031)
@@ -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