PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
try:
from werkzeug.debug import tbtools
from werkzeug.utils import escape
tbtools.FRAME_HTML = u'''\
File %(filename)s,
line %(lineno)s,
in %(function_name)s
%(current_line)s
'''
def myrender(self):
return tbtools.FRAME_HTML % {
'id': self.id,
'projectfile': 'firebrick' if self.filename.find(PROJECT_DIR) == 0 else 'inherit',
'filename': escape(self.filename),
'lineno': self.lineno,
'function_name': escape(self.function_name),
'current_line': escape(self.current_line.strip())
}
tbtools.Frame.render = myrender
except ImportError:
pass