kai / kai / templates / tracebacks / show.mako

<div class="yui-b content">
    <% combined_exc = '%s: %s' % (c.traceback.exception_type, c.traceback.exception_value) %>
    <h1>${h.link_to(combined_exc, url=url.current())}</h1>
    <div class="traceback_posted">\
        % if c.is_owner:
        <div class="traceback_delete">${h.link_to('Delete', id_='delete_traceback')}</div>
        % endif
        ${widgets.format_timestamp(c.traceback.created)} by
        <span class="traceback_author">${ if else 'Anonymous'}</span>\
    <div class="traceback">
            sort = request.GET.get('sort')
            options = ['In Call Order', 'Reverse Call Order']
            if sort and sort not in options:
                sort = options[0]
        <div class="sort_order">${'order', sort, options, id='sort_order',
            onchange="document.location='%s?sort=' + document.getElementById('sort_order').value" % url.current())}</div>
            if sort == options[1]:
                frames = c.traceback.frames[::-1]
                frames = c.traceback.frames
        % if sort == options[1]:
        <blockquote>${c.traceback.exception_type}: ${c.traceback.exception_value}</blockquote>
        % endif
        % for frame in frames:
            <cite>${frame['module']}</cite> : <em>${frame['line']}</em>, in \
            ${highlight(frame['operation'], py_lexer, html_formatter) | n}\
        % endfor
        % if not sort or sort == options[0]:
        <blockquote>${c.traceback.exception_type}: ${c.traceback.exception_value}</blockquote>
        % endif
        <div class="description">
            <p>${c.traceback.description if c.traceback.description else 'No Description Entered'}</p>
        <div class="sysinfo">
            <div class="language"><span class="language">${c.traceback.language}</span>: <span class="version">${c.traceback.version}</span></div>
            <table id="traceback_libs">
                        libs = sorted(list(c.traceback.libraries), lambda x,y: cmp(,
                    % for lib in libs:
                    <tr><td>${}</td><td class="version">${lib.version}</td></tr>
                    % endfor
<%namespace name="widgets" file="/widgets.mako"/>
<%def name="title()">${parent.title()} - ${_('Traceback %s' %}</%def>\
<%def name="javascript()">
$(document).ready(function() {
    $('#delete_traceback').click(function() {
        var answer = window.confirm("Are you sure you want to delete this traceback?");
        if (answer) {
                data: {"_method":"DELETE"},
                type: "POST",
                url: location.pathname,
                success: function(data, textStatus) {
                    window.location = '/tracebacks';
        return false;
<%inherit file="../layout.mako" />\
from datetime import datetime
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import HtmlFormatter
py_lexer = PythonLexer()
html_formatter = HtmlFormatter()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.