(self, args, kwargs)
Implement handler matching on arguments for set_handlers and
        remove_handlers.
Implement handler matching on arguments for set_handlers and
        remove_handlers.
Implement handler matching on arguments for set_handlers and remove_handlers .
def _get_handlers(self, args, kwargs):
        '''Implement handler matching on arguments for set_handlers and
        remove_handlers.
        '''
        for object in args:
            if inspect.isroutine(object):
                # Single magically named function
                name = object.__name__
                if name not in self.event_types:
                    raise EventException('Unknown event "%s"' % name)
                yield name, object
            else:
                # Single instance with magically named methods
                for name in dir(object):
                    if name in self.event_types:
                        yield name, getattr(object, name)
        for name, handler in kwargs.items():
            # Function for handling given event (no magic)
            if name not in self.event_types:
                raise EventException('Unknown event "%s"' % name)
            yield name, handler
def _get_handlers ( self , args , kwargs ) : for object in args : if inspect . isroutine ( object ) : # Single magically named function name = object . __name__ if name not in self . event_types : raise EventException ( 'Unknown event "%s"' % name ) yield name , object else : # Single instance with magically named methods for name in dir ( object ) : if name in self . event_types : yield name , getattr ( object , name ) for name , handler in kwargs . items ( ) : # Function for handling given event (no magic) if name not in self . event_types : raise EventException ( 'Unknown event "%s"' % name ) yield name , handler