Beispiel #1
0
 def _polling_timeout(self, request, callback):
     try:
         # WARNING Lighttpd ModProxyCore will not finish the request
         utils.no_content(request)
         request.finish()
     except:
         import traceback
         log.error("error: %s" % (traceback.format_exc(), ))
Beispiel #2
0
 def _polling_timeout(self, request, callback):
     try:
         # WARNING Lighttpd ModProxyCore will not finish the request
         utils.no_content(request)
         request.finish()
     except:
         import traceback
         log.error("error: %s" % (traceback.format_exc(), ))
Beispiel #3
0
 def render_json(self, request, data, finish=True):
     if data:
         data = json.dumps(data)
     else:
         return utils.no_content(request)
     request.write(data)
     if finish:
         request.finish()
Beispiel #4
0
 def render_json(self, request, data, finish = True):
     if data:
         data = json.dumps(data)
     else:
         return utils.no_content(request)
     request.write(data)
     if finish:
         request.finish()
Beispiel #5
0
    def render_JSON(self, request, data):
        if data != server.NOT_DONE_YET:
            if data:
                request.setHeader('content-type', 'application/json')
                return json.dumps(data)
            else:
                request.setHeader('content-type', 'text/plain')
                return utils.no_content(request)

        # return raw output
        request.setHeader('content-type', 'application/octet-stream')
        return data
Beispiel #6
0
    def render_JSON(self, request, data):
        if data != server.NOT_DONE_YET:
            if data:
                request.setHeader('content-type', 'application/json')
                return json.dumps(data)
            else:
                request.setHeader('content-type', 'text/plain')
                return utils.no_content(request)

        # return raw output
        request.setHeader('content-type', 'application/octet-stream')
        return data
Beispiel #7
0
    def _render(self, request, data=None):
        request.setHeader('content-type', 'application/json')
        if data != None:
            output = self.method(request, data)
        else:
            output = self.method(request)

        if output != server.NOT_DONE_YET:
            if output:
                return json.dumps(output)
            else:
                return utils.no_content(request)

        # return raw output
        return output
Beispiel #8
0
    def _render(self, request, data = None):
        request.setHeader('content-type', 'application/json')
        if data != None:
            output = self.method(request, data)
        else:
            output = self.method(request)

        if output != server.NOT_DONE_YET:
            if output:
                return json.dumps(output)
            else:
                return utils.no_content(request)

        # return raw output
        return output