Commits

Ronny Pfannschmidt committed 4ea6516

small untested code fix

Comments (0)

Files changed (1)

gtkarchitect/model/definitions.py

 Defines how widgets are displayed in gazpacho
 """
 
+from collections import defaultdict
+
 from .entity import get_entity_type
 
 
 class EntityCatalog(object):
 
     def __init__(self):
-        self.entity_defs = {}
+        self.entity_defs = defaultdict(list)
         self.entity_map = {}
 
     def register_entity_def(self, category, definition):
-        self.entity_defs.setdefault(category, []).append(definition)
+        self.entity_defs[category].append(definition)
         self.entity_map[definition.entity_name] = definition
 
     def get_entity_def(self, name):
-        return self.entity_map.get('name')
+        return self.entity_map.get(name)
 
 entity_catalog = EntityCatalog()