Is there a wiki processor for Trac for formatting and color tracing of Python?

It is clear that many of the tickets that we record in Trac contain traces. It would be great if they were well formatted and syntax highlighted.

I did a quick Google search for the Python traceback wiki and couldn't find any quick hits.

I will gladly download my own if someone can recommend a trace formatter (stand-alone or built-in to an open source project) that outputs HTML / reStructuredText / etc.

+4
source share
3 answers

Pygments supports Python syntax coloring for tracebacks, and there is a trac plugin , but the Trac 0.11 wiki statement supports Pyigs natively.

+2
source

I do not think you need this patch. You can specify the short code mapping in trac.ini , but you can also (at least in trac 0.12) just use the mime type directly:

{{{ #!text/x-python-traceback <traceback> }}} 

See more at http://trac.edgewall.org/wiki/TracSyntaxColoring . x-python-traceback is not listed, but you will get a preview of the error if trac fails to handle it, and that is WorkedForMe.

+4
source

Trac 0.11 supports Pygments, but does not disclose the pytb formatting type. Here's a bug fixed with Trac 0.11.3 to add support for Python traces.

 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'], 
+2
source

All Articles