コード例 #1
0
 def display(self, request):
     d = defer.Deferred()
     d2 = defer.Deferred()
     d3 = defer.Deferred()
     d.callback([d2])
     d2.callback([d3])
     d3.callback(["correct"])
     return [d]
コード例 #2
0
    def getIdentityRequest(self, name):
        """Get a Deferred callback registration object.

        I return a deferred (twisted.python.defer.Deferred) which will
        be called back to when an identity is discovered to be available
        (or errback for unavailable).  It will be returned unarmed, so
        you must arm it yourself.
        """

        req = defer.Deferred()
        if self.identities.has_key(name):
            req.callback(self.identities[name])
        else:
            req.errback("unauthorized")
        return req
コード例 #3
0
 def remote_doItLater(self):
     d = defer.Deferred()
     d.addCallbacks(self.runMe, self.dontRunMe)
     self.d = d
     return d
コード例 #4
0
ファイル: widgets.py プロジェクト: katrinleinweber/songclub
 def __init__(self):
     self.deferred = defer.Deferred()
     self.io = StringIO()
     self.write = self.io.write
コード例 #5
0
 def display(self, request):
     d = defer.Deferred()
     d.callback(["correct"])
     return [d]
コード例 #6
0
 def display(self, request):
     d = defer.Deferred()
     d.callback([self.text])
     return [d]
コード例 #7
0
ファイル: pbweb.py プロジェクト: katrinleinweber/songclub
 def makeListOf(self, echoer):
     d = defer.Deferred()
     echoer.echo(self.echotext, pbcallback=d.callback, pberrback=d.errback)
     d.addCallbacks(widgets.listify, self.formatTraceback)
     return [d]
コード例 #8
0
ファイル: pbweb.py プロジェクト: katrinleinweber/songclub
 def getEchoPerspective(self):
     d = defer.Deferred()
     pb.connect(d.callback, d.errback, "localhost", pb.portno, "guest",
                "guest", "pbecho", "guest", 1)
     d.addCallbacks(self.makeListOf, self.formatTraceback)
     return ['<b>', d, '</b>']