예제 #1
0
def entry(request):

    ret = chain.run([route], request=request)
    body = ret.get('render')
    content_type = ret.get('content_type')
    
    return Response(body, content_type=content_type)
예제 #2
0
파일: main.py 프로젝트: muromec/iromidori
 def chain(self, args):
     from iromidori.evapi import route
     kw = {
             "request": self.request,
             "url": self.request.path[4:], # XXX!
     }
     kw.update(args)  # XXX: insecure!
     ret = chain.run([route], **kw)
     json = ret.get('json') or "Nani-Nani"
     self.write(json)
예제 #3
0
파일: main.py 프로젝트: muromec/jscrap-demo
def application(environ, start_response):
    """
    Typical werkzeug app, nothing special.

    Here I`m handling incoming request and passing it to
    chain of functions (route, response).

    Execution context is almost empty, except our request.

    """

    request = Request(environ, populate_request=False)
    ret = chain.run([route, response], request=request)
    return ret['response'](environ, start_response)
예제 #4
0
파일: events.py 프로젝트: muromec/iromidori
def evapi(**kw):
    return chain.run([route], **kw)
예제 #5
0
파일: evapi.py 프로젝트: muromec/iromidori
def evapi(**kw):
    return chain.run([parse, route], **kw)