Ejemplo n.º 1
0
    def _validate_subscriber_methods(cls):
        for subscriber_type in cls.VALID_SUBSCRIBER_TYPES:
            subscriber_method = getattr(cls, 'on_' + subscriber_type)
            if not six.callable(subscriber_method):
                raise InvalidSubscriberMethodError(
                    'Subscriber method %s must be callable.' %
                    subscriber_method)

            if not accepts_kwargs(subscriber_method):
                raise InvalidSubscriberMethodError(
                    'Subscriber method %s must accept keyword '
                    'arguments (**kwargs)' % subscriber_method)
Ejemplo n.º 2
0
    def _validate_subscriber_methods(cls):
        for subscriber_type in cls.VALID_SUBSCRIBER_TYPES:
            subscriber_method = getattr(cls, 'on_' + subscriber_type)
            if not six.callable(subscriber_method):
                raise InvalidSubscriberMethodError(
                    'Subscriber method %s must be callable.' %
                    subscriber_method)

            if not accepts_kwargs(subscriber_method):
                raise InvalidSubscriberMethodError(
                    'Subscriber method %s must accept keyword '
                    'arguments (**kwargs)' % subscriber_method)
Ejemplo n.º 3
0
 def _verify_is_callable(self, func):
     if not six.callable(func):
         raise ValueError("Event handler %s must be callable." % func)
Ejemplo n.º 4
0
 def _verify_is_callable(self, func):
     if not six.callable(func):
         raise ValueError("Event handler %s must be callable." % func)