[Twisted-Python] How do I run a twisted server directly

Alexander May alex-news at comcast.net
Fri May 14 23:05:43 MDT 2004


> You should just be able to import the komodo debugging shim module at the
top of your .tac file, start it using twistd, and debug just fine.

You mentioned that it has been a while, but does callkomodo.py sound right?
Or is the "komodo debugging shim module" something else?  I've tried a few
things, none of which have worked well.  Of course it is way past my bedtime
so I'm no longer thinking straight.  

Also using this technique, will there be an issue when I move my code into
production?  Is the import meaningless if I'm not running under the
debugger?  Or will I have to remember to remove the import line for the
debug module.  Or can I conditional import it using __debug__ and pass the
-O flag through when using twistd?  I apologize for my lack of knowledge;
I've stayed happily ignorant of the workings of the debugger until now.

What does everybody else here use for a development environment/debugger
when writing twisted or twisted apps?  Any IDE users out there?  I don't
want to waste more time than I already have just setting up my environment. 

Alex



-----Original Message-----
From: twisted-python-bounces at twistedmatrix.com
[mailto:twisted-python-bounces at twistedmatrix.com] On Behalf Of Donovan
Preston
Sent: Saturday, May 15, 2004 12:00 AM
To: Twisted discussion stuff
Subject: Re: [Twisted-Python] How do I run a twisted server directly


On May 14, 2004, at 10:02 PM, Alexander May wrote:

> I've use pythonwin for a while and I'm giving Komodo try right now.  
> I'll
> try Python.NET soon too.

<snip>

>
> Which seems to work.  I can start my application from the debugger and 
> hit breakpoints, etc.
>
> Presumably I've committed all sort of horrors writing this code.  
> Please
> feel free to enlighten me to the error of my ways.  Also, I'm curious 
> what is the function of the following line of code (marked with a *) 
> is which I saw in twistw:

<snip>

Why are you assuming that you can't use twistd and komodo's debugger at the
same time? The last time I looked at Komodo for debugging (which admittedly
was at least two years ago) importing the debugging module at any time
installed the trace hook and queried Komodo for breakpoints. Then, any time
the trace hook wanted to break into the debugger, it made a synchronous,
blocking call over xmlrpc into the Komodo process. The Komodo process would
then delay 'returning' from that xmlrpc call until you pressed step or
continue in the ui.

You should just be able to import the komodo debugging shim module at the
top of your .tac file, start it using twistd, and debug just fine.

dp


_______________________________________________
Twisted-Python mailing list
Twisted-Python at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python





More information about the Twisted-Python mailing list