Prev Next

<p>Welcome to the wonderful world of Nevow,
<span nevow:data="group_name" nevow:render="string" />!</p>

class Page(rend.Page):
docFactory = loaders.htmlfile('hellohtml.html')
def data_group_name (self, context, data):
def succeed (s):
return s.upper ()
d = defer.Deferred ().addCallback (succeed)
reactor.callLater (10, d.callback, 'chipy')
return d

Note this doesn't handle failure of the callback. Deferred has additional methods

addErrback (error)
and a convenience method
addCallbacks
which takes both a success and error callback.