git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64856 15284696-431f-4ddb-bdfa-cd5b030d7da7
@@ -1206,7 +1206,7 @@ class CmdPanel(wx.Panel):
extraItems = {_('Graphical Modeler') : self._giface.GetLayerList(p.get('prompt'))}
else:
layers = self._giface.GetLayerList()
- if layers:
+ if len(layers) > 0:
mapList = []
extraItems = {_('Map Display') : mapList}
for layer in layers:
@@ -47,6 +47,9 @@ class LayerList(object):
def __init__(self, tree):
self._tree = tree
+ def __len__(self):
+ return len([layer for layer in self])
+
def __iter__(self):
"""Iterates over the contents of the list."""
item = self._tree.GetFirstChild(self._tree.root)[0]