[Twisted-Python] callback wierdness
justinjohnson at fastmail.fm
Wed Jul 30 08:59:17 EDT 2003
Found my problem, and indeed I *did* need to add the errback to discover
it. Thanks again. :-)
On Wed, 30 Jul 2003 11:47:26 +1000, "Andrew Bennetts"
<andrew-twisted at puzzling.org> said:
> On Tue, Jul 29, 2003 at 07:12:03AM -0600, Justin Johnson wrote:
> > In the attached files I defined process.openProcess to spawn a process
> > using the reactor, and return a deferred from within my ProcessProtocol.
> > Then in trigger.py I define methods "make" and "remove" that utilize
> > process.openProcess to run a command. make() adds callbacks to the
> > deferred to display the results of the execution, and at the bottom of
> > trigger.py I add a callback to remove the trigger after creating it.
> > The problem is, none of my callbacks ever get called. The initial
> > spawnProcess works and I can see the trigger is created, but nothing is
> > printed to the screen (callback 1 added in "make") and the trigger is not
> > removed (callback 2 added at end of file).
> Without looking closely, I notice that you never add an errback to your
> Deferreds, only callbacks. Try d.addErrback(twisted.python.log.err), and
> see if that helps you figure out what's going wrong.
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python