[Twisted-Python] callback wierdness

Justin Johnson justinjohnson at fastmail.fm
Tue Jul 29 09:12:03 EDT 2003

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).

Can someone tell me what I'm doing wrong here?  Also, is spawnProcess a
special case that actually runs before reactor.run is called?  That is
what I am seeing, and I'm not sure if that makes sense.  Just trying to
get my head around this.

Thanks much.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trigger.py
Type: application/unknown
Size: 2888 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030729/e1d9d5e1/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: process.py
Type: application/unknown
Size: 1619 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030729/e1d9d5e1/attachment-0001.bin 

More information about the Twisted-Python mailing list