Ejemplo n.º 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(), ))
Ejemplo n.º 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(), ))
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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