コード例 #1
0
ファイル: common_web.py プロジェクト: zhutony/tahoe-lafs
 def render2(self, page, **kwargs):
     # use this to exercise the normal Nevow docFactory rendering. It
     # returns a string. If one of the render_* methods returns a
     # Deferred, this will throw an exception. (note that
     # page.renderString is the Deferred-returning equivalent)
     req = FakeRequest(**kwargs)
     req.fields = None
     ctx = self.make_context(req)
     return page.renderSynchronously(ctx)
コード例 #2
0
ファイル: common_web.py プロジェクト: ArtRichards/tahoe-lafs
 def render2(self, page, **kwargs):
     # use this to exercise the normal Nevow docFactory rendering. It
     # returns a string. If one of the render_* methods returns a
     # Deferred, this will throw an exception. (note that
     # page.renderString is the Deferred-returning equivalent)
     req = FakeRequest(**kwargs)
     req.fields = None
     ctx = self.make_context(req)
     return page.renderSynchronously(ctx)
コード例 #3
0
ファイル: common_web.py プロジェクト: zhutony/tahoe-lafs
 def render1(self, page, **kwargs):
     # use this to exercise an overridden renderHTTP, usually for
     # output=json or render_GET. It always returns a Deferred.
     req = FakeRequest(**kwargs)
     req.fields = None
     ctx = self.make_context(req)
     d = defer.maybeDeferred(page.renderHTTP, ctx)
     def _done(res):
         if isinstance(res, str):
             return res + req.v
         return req.v
     d.addCallback(_done)
     return d
コード例 #4
0
ファイル: common_web.py プロジェクト: ArtRichards/tahoe-lafs
 def render1(self, page, **kwargs):
     # use this to exercise an overridden renderHTTP, usually for
     # output=json or render_GET. It always returns a Deferred.
     req = FakeRequest(**kwargs)
     req.fields = None
     ctx = self.make_context(req)
     d = defer.maybeDeferred(page.renderHTTP, ctx)
     def _done(res):
         if isinstance(res, str):
             return res + req.v
         return req.v
     d.addCallback(_done)
     return d