Created
November 27, 2012 19:11
-
-
Save dplepage/4156332 to your computer and use it in GitHub Desktop.
Put an editor URL in Werkzeug's debugger pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This quick hack wraps the filenames in the Werkzeug debugger with a link that opens them in my editor. | |
In my particular case I have Sublime Text and SublHandler on OS X (urls below), so my links point to subl://open/?url=<file url>, but you can easily change this for any other URL handler. | |
Sublime Text: http://www.sublimetext.com/ | |
SublHandler (for OS X): https://github.com/asuth/subl-handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import werkzeug.debug.tbtools as tbt | |
tbt.FRAME_HTML = u'''\ | |
<div class="frame" id="frame-%(id)d"> | |
<h4> | |
File | |
<a href="subl://open/?url=file://%(filename)s&line=%(lineno)s"> | |
<cite class="filename">"%(filename)s"</cite></a>, | |
line <em class="line">%(lineno)s</em>, | |
in <code class="function">%(function_name)s</code></h4> | |
<pre>%(current_line)s</pre> | |
</div> | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment