Пример #1
0
    def get_request_callback(self):
        class Handler(RequestHandler):
            def data(self):
                self.finish()
                self.finish()

        return Application(Handler)
Пример #2
0
    def get_request_callback(self):
        class Handler(RequestHandler):
            def data(self):
                raise errors.SMTPError(self.settings['status_code'],
                                       self.settings['message'])

        return Application(Handler,
                           status_code=self.status_code,
                           message=self.message)
Пример #3
0
    def get_request_callback(self):
        class Handler(RequestHandler):
            def data(h):
                self.request_mail = h.request.mail
                self.request_rcpt = h.request.rcpt
                self.request_data = h.request.data
                self.request_message = h.request.message
                self.request_repr = '%s' % h.request

        return Application(Handler)
Пример #4
0
    def get_request_callback(self):
        class Handler(RequestHandler):
            @gen.coroutine
            def coroutine_decorated(h):
                raise gen.Return(self.coroutine_result)

            @gen.coroutine
            def data(h):
                self.data_result = yield h.coroutine_decorated()

        return Application(Handler)
Пример #5
0
    def get_request_callback(self):
        class Handler(RequestHandler):
            def data(self):
                return True

        return Application(Handler)
Пример #6
0
    def get_request_callback(self):
        class Handler(RequestHandler):
            def data(self):
                raise Exception('This is a custom exception')

        return Application(Handler)
Пример #7
0
    def get_request_callback(self):
        class Handler(RequestHandler):
            pass

        return Application(Handler)