~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/annotate_ui.py

  • Committer: Michael Hudson
  • Date: 2009-03-02 06:10:32 UTC
  • Revision ID: michael.hudson@canonical.com-20090302061032-tw61av5ljg2ikbjc
make pygments optional

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from paste.httpexceptions import HTTPBadRequest, HTTPServerError
27
27
 
28
28
from loggerhead.controllers import TemplatedBranchView
29
 
from loggerhead.highlight import highlight
 
29
try:
 
30
    from loggerhead.highlight import highlight
 
31
except ImportError:
 
32
    highlight = None
30
33
from loggerhead import util
31
34
 
32
35
 
53
56
                                     text='(This is a binary file.)',
54
57
                                     change=util.Container())
55
58
        else:
56
 
            hl_lines = highlight(file_name, ''.join(file_lines))
 
59
            if highlight is not None:
 
60
                hl_lines = highlight(file_name, ''.join(file_lines))
 
61
            else:
 
62
                hl_lines = file_lines
57
63
 
58
64
            change_cache = {}
59
65