views:

108

answers:

2

Understandably many of the tickets we file in Trac contain tracebacks. It would be excellent if these were nicely formatted and syntax highlighted.

I've conducted a cursory Google search for a Python traceback wiki processor and have not found any quick hits.

I'm happy to roll my own if anyone can recommend a traceback formatter (stand alone or embedded in an open source project) that outputs HTML/reStructuredText/etc.

+1  A: 

Pygments has support for syntax-coloring Python tracebacks, and there's a trac plugin, but the wiki page claims Trac 0.11 supports Pygments natively.

Ned Batchelder
+1  A: 

Trac 0.11 supports Pygments but doesn't expose the pytb formatting type. Here's a patch against Trac 0.11.3 to add support for Python tracebacks.

diff -r 5a0c5e3255b4 mimeview/api.py
--- a/mimeview/api.py   Tue Aug 11 11:33:45 2009 +1000
+++ b/mimeview/api.py   Mon Aug 24 15:13:34 2009 +1000
@@ -348,6 +348,7 @@
     'text/x-perl':            ['pl', 'pm', 'PL', 'perl'],
     'text/x-php':             ['php', 'php3', 'php4'],
     'text/x-python':          ['py', 'python'],
+    'text/x-python-traceback':['pytb'],
     'text/x-pyrex':           ['pyx'],
     'text/x-ruby':            ['rb', 'ruby'],
     'text/x-scheme':          ['scm'],
brotchie