Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime, Python, web servers and setting breakpoints

What's the recommended method to debug Python web servers (I have Plone/Zope) with Sublime Text 2?

  • Set real breakpoints in the text editor...

  • ... preferably through line context sensitive command and have a marker in the text editor margin ...

  • ...then have a running Python web server (local process) instantly honour the breakpoints without restart...

  • ... and when hitting the breakpoint open a debug prompt in a terminal or some other window, can be pdb

The goal is that the breakpoints would not be hard import pdb ; pdb.set_trace() style breakpoints as you need to restart the software to skip such breakpoint and you cannot enable / disable it run-time.

Platform: OSX.

like image 468
Mikko Ohtamaa Avatar asked Nov 03 '22 20:11

Mikko Ohtamaa


1 Answers

mr.freeze provides a way to set a breakpoint in a running Zope instance without restarting, and a sample script for integrating it with TextMate (triggered via a key shortcut). It would take a bit of work to turn it into a Sublime Text plugin, but it would be a good starting point.

The sample TextMate scripts are in the README but not released.

like image 174
David Glick Avatar answered Nov 09 '22 23:11

David Glick