Esempio n. 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]
Esempio n. 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
Esempio n. 3
0
 def remote_doItLater(self):
     d = defer.Deferred()
     d.addCallbacks(self.runMe, self.dontRunMe)
     self.d = d
     return d
Esempio n. 4
0
 def __init__(self):
     self.deferred = defer.Deferred()
     self.io = StringIO()
     self.write = self.io.write
Esempio n. 5
0
 def display(self, request):
     d = defer.Deferred()
     d.callback(["correct"])
     return [d]
Esempio n. 6
0
 def display(self, request):
     d = defer.Deferred()
     d.callback([self.text])
     return [d]
Esempio n. 7
0
 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]
Esempio n. 8
0
 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>']