def add_event_listener(self, event_type, listener):
        """
        Add an event listener for an event type
        """
        # Add listener to the event type
        if not self.has_listener( event_type, listener ):
            listeners = self._events.get( event_type, [] )
        
            listeners.append( listener )
            
            self._events[ event_type ] = listeners

        Add an event listener for an event type
        
recipes/Python/577432_Simple_event_dispatcher/recipe-577432.py