Hi Mat,

I'm using pdb with success.

1. in SDK comment out line: "sys.meta_path = [hook]" in
dev_appserver.py (Warning: this will disable hardened production-like
environment dev_appserver provides for your local app!)
2. use following code to put trace in your app:
def b():
  import pdb, sys
  sys.__stdout__.write('\a')
  sys.__stdout__.flush()
  debugger = pdb.Pdb(stdin=sys.__stdin__, stdout=sys.__stdout__)
  debugger.set_trace(sys._getframe().f_back)

I have this function dbg module and small textmate snippet which puts:
import dbg;dbg.b() # where you want breakpoint

regards,
Antonin

Note: once I was able to use pdb without global sys.meta patch by
temporarily patching sys.meta in my main handler. This doesn't work
for me anymore (maybe some caching issues or some newly hardened parts
got into the way, I don't know I'm not a python pro)

You may also check FirePython for aid in debugging your app:
http://github.com/darwin/firepython/tree/master

On Jan 24, 7:48 am, Mat <matdrap...@gmail.com> wrote:
> Hi,
> I really would like to use pdb as my main way to debug an old app that
> I received from a third-party.
> Does it have a way to enable it by modifying the dev server code?
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to