def dispatch(self, event, *args, **kwargs):
        """Dispatches an event.

           If any of the attached listeners throws an exception, the
           subsequent callbacks are be aborted.

        :param str event: event to dispatch.
        :param list args: arguments to pass to event handlers.
        """

        # noinspection PyCallingNonCallable
        try:
            handler = getattr(self.main_screen, event)
            handler(*args)
        except AttributeError:
            pass

        if kwargs.get('reset', True):
            self.reset()
Dispatches an event.

           If any of the attached listeners throws an exception, the
           subsequent callbacks are be aborted.

        :param str event: event to dispatch.
        :param list args: arguments to pass to event handlers.
        
system/shstreams.py