def get_command_handler(self, command):
        handler = getattr(self.commands_module, "handle_%s" % command.lower(), None)
        if handler and callable(handler):
            return handler

        for receiver, handler in get_basket_command_handler.send(
                BasketCommandDispatcher, command=command, instance=self):
            if handler and callable(handler):
                return handler
Пример #2
0
    def get_command_handler(self, command):
        handler = getattr(self.commands_module, "handle_%s" % command.lower(), None)
        if handler and callable(handler):
            return handler

        for receiver, handler in get_basket_command_handler.send(
                BasketCommandDispatcher, command=command, instance=self):
            if handler and callable(handler):
                return handler