[GRASS-SVN] r57625 - grass/trunk/gui/wxpython/lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 10 05:38:00 PDT 2013


Author: annakrat
Date: 2013-09-10 05:38:00 -0700 (Tue, 10 Sep 2013)
New Revision: 57625

Modified:
   grass/trunk/gui/wxpython/lmgr/layertree.py
Log:
wxGUI/layertree: fix case when layer has no properties yet

Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2013-09-10 12:33:35 UTC (rev 57624)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2013-09-10 12:38:00 UTC (rev 57625)
@@ -340,6 +340,8 @@
         @param key cmd, type, ctrl, label, maplayer, propwin, vdigit, nviz
          (vdigit, nviz for map layers only)
         """
+        if not self.GetPyData(layer):
+            return None
         if key:
             return self.GetPyData(layer)[0][key]
         return self.GetPyData(layer)[0]
@@ -1529,7 +1531,8 @@
         itemList = ""
         for item in range(self.GetCount()):
             itemList += self.GetItemText(vislayer) + ','
-            if self.GetLayerInfo(vislayer, key='type') != 'group':
+            lType = self.GetLayerInfo(vislayer, key='type')
+            if lType and lType != 'group':
                 layers.append(self.GetLayerInfo(vislayer, key='maplayer'))
 
             if not self.GetNextVisible(vislayer):



More information about the grass-commit mailing list