Changeset 439

Show
Ignore:
Timestamp:
12/22/08 15:27:37 (5 years ago)
Author:
ged
Message:

add extend method on entity collection

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/elixir/collection.py

    r436 r439  
    88# default entity collection 
    99class EntityCollection(list): 
    10     def __init__(self): 
     10    def __init__(self, entities=None): 
    1111        # _entities is a dict of entities keyed on their name. 
    1212        self._entities = {} 
    1313        list.__init__(self) 
     14        if entities is not None: 
     15            self.extend(entities) 
     16 
     17    def extend(self, entities): 
     18        for e in entities: 
     19            self.append(e) 
    1420 
    1521    def append(self, entity):