Skip to content

Instantly share code, notes, and snippets.

View nod's full-sized avatar
💻
i writes the codes, sometimes.

Jeremy Kelley nod

💻
i writes the codes, sometimes.
View GitHub Profile
@nod
nod / pdbcolor.py
Created March 16, 2011 16:24
syntax highlighting for pdb source listings
# put the following in your usercustomize.py file.
# see https://33ad.org/blog/pycon-2011-and-colorized-pdb-source-listings
# for more info and explanation.
# colorize pdb source output
import pdb
import StringIO
from pygments import highlight
from pygments.lexers import PythonLexer, PythonTracebackLexer
from pygments.formatters import TerminalFormatter
import tornado.web
class route(object):
"""
decorates RequestHandlers and builds up a list of routables handlers
Tech Notes (or "What the *@# is really happening here?")
--------------------------------------------------------
Everytime @route('...') is called, we instantiate a new route object which
class BaseHandler(RequestHandler):
# .... other stuff ....
def _handle_request_exception(self, e):
RequestHandler._handle_request_exception(self,e)
import pdb
pdb.post_mortem()
def bp():