[wingide-users] Advice needed on debugging with Twisted/Stackless combo

Simon Pickles sipickles at hotmail.com
Sat Apr 12 14:03:42 MDT 2008


Hi,

I'm using stackless python and Twisted in WingIDE.

Unfortunately, I have no debugger support or breakpoints. It seems wing 
cannot monitor a reactor in a stackless tasklet.

Take this example:

#START------------------------------------------------------------------------------------------
import stackless
from twisted.internet import reactor, task
from time import sleep


def foo():
    x = 0
    while 1:
        sleep(1)
        print x
        x += 1
   
stackless.tasklet(foo)()
   
task.LoopingCall(stackless.schedule).start(0.0001)
stackless.tasklet(reactor.run)()
stackless.run()

#END------------------------------------------------------------------------------------------

Putting a breakpoint in the foo function will not trigger.

Further investigation shows no breakpoints work in this next code, even 
tho this is only using stackless:

#START------------------------------------------------------------------------------------------
import stackless
from twisted.internet import reactor, task
from time import sleep


def foo():
    x = 0
    while 1:
        sleep(1)
        print x
        x += 1
        stackless.schedule()
       
def bar():
    x = 65
    while 1:
        sleep(1)
        print chr(x)
        x += 1
        stackless.schedule()
   
stackless.tasklet(foo)()
stackless.tasklet(bar)()
   
stackless.run()

#END------------------------------------------------------------------------------------------

I heard that Wing IDE had been in discussion with various members of the 
Stackless and Twisted communities at PyCon 2008.

I wondered if any resolution to my problem above has been found? I am 
struggling without breakpoints!

Thanks

Simon



-- 
Linux user #458601 - http://counter.li.org.





More information about the wingide-users mailing list