瀏覽代碼

wxGUI: check if vector exists

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@45030 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 年之前
父節點
當前提交
ecd834e821
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      gui/wxpython/gui_modules/menuform.py

+ 2 - 4
gui/wxpython/gui_modules/menuform.py

@@ -272,7 +272,7 @@ class UpdateThread(Thread):
                         table = pTable.get('value', '')
                 
             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()
             
@@ -297,13 +297,11 @@ class UpdateThread(Thread):
                 
             elif name == 'ColumnSelect':
                 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
                     if driver and db:
                         self.data[win.InsertTableColumns] = { 'table' : pTable.get('value'),