예제 #1
0
 def getResourceFor(self, root, url):
     r = testutil.FakeRequest()
     self.request = r
     r.postpath = url.split('/')
     deferred = util.maybeDeferred(
         appserver.NevowSite(root).getResourceFor, r)
     return util.deferredResult(deferred)
예제 #2
0
 def getResourceFor(self, root, url):
     r = testutil.FakeRequest()
     self.request = r
     r.postpath = url.split('/')
     deferred = util.maybeDeferred(appserver.NevowSite(root).getResourceFor, r)
     return util.deferredResult(
         deferred
     )
예제 #3
0
def deferredRender(res):
    defres = req()
    d = res.renderHTTP(
        context.PageContext(tag=res,
                            parent=context.RequestContext(tag=defres)))

    def accumulated(result, req):
        return req.accumulator

    return util.deferredResult(d.addCallback(accumulated, defres), timeout=1)
예제 #4
0
def deferredRender(res):
    defres = req()
    d = res.renderHTTP(context.PageContext(tag=res, parent=context.RequestContext(tag=defres)))
    def accumulated(result, req):
        return req.accumulator
    return util.deferredResult(d.addCallback(accumulated, defres), timeout=1)
예제 #5
0
 def renderResource(self, resource, path):
     s = appserver.NevowSite(resource)
     r = appserver.NevowRequest(testutil.FakeChannel(s), True)
     r.path = path
     D = r.process()
     return util.deferredResult(D)
예제 #6
0
 def renderResource(self, resource, path):
     s = appserver.NevowSite(resource)
     r = appserver.NevowRequest(testutil.FakeChannel(s), True)
     r.path = path
     D = r.process()
     return util.deferredResult(D)