aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django
diff options
context:
space:
mode:
authorbnewbold <bnewbold@manus.(none)>2007-06-01 04:03:56 -0400
committerbnewbold <bnewbold@manus.(none)>2007-06-01 04:03:56 -0400
commit4f161df1591959b6052ba966addfce88f84d3ab2 (patch)
treec5658e0c8bfbef08892fb47742fcbcf934fa62ef /bn_django
parent23ffcd2dd06e7193fa7c54aa3f4956922aafdf2a (diff)
downloadbnewnet-4f161df1591959b6052ba966addfce88f84d3ab2.tar.gz
bnewnet-4f161df1591959b6052ba966addfce88f84d3ab2.zip
falls through if pygments not detected
Diffstat (limited to 'bn_django')
-rw-r--r--bn_django/git_browse/views.py11
-rw-r--r--bn_django/git_wiki/views.py12
2 files changed, 12 insertions, 11 deletions
diff --git a/bn_django/git_browse/views.py b/bn_django/git_browse/views.py
index 2722db2..e953d26 100644
--- a/bn_django/git_browse/views.py
+++ b/bn_django/git_browse/views.py
@@ -107,11 +107,12 @@ def view_commit(request, repo, hash):
c = Commit(id=hash,repo=therepo)
c.update()
- from pygments import highlight
- from pygments.lexers import DiffLexer
- from pygments.formatters import HtmlFormatter
-
- c.pretty_diff = highlight(c.rawdiff, DiffLexer(), HtmlFormatter())
+ try:
+ from pygments import highlight
+ from pygments.lexers import DiffLexer
+ from pygments.formatters import HtmlFormatter
+ c.pretty_diff = highlight(c.rawdiff, DiffLexer(), HtmlFormatter())
+ except: pass
return render_to_response('git_browse/commit.html',
dict(object=therepo, heads=heads, tags=tags,
diff --git a/bn_django/git_wiki/views.py b/bn_django/git_wiki/views.py
index dcd1646..58d4194 100644
--- a/bn_django/git_wiki/views.py
+++ b/bn_django/git_wiki/views.py
@@ -223,12 +223,12 @@ def view_commit(request, hash):
(heads, tags) = reposcan()
c = Commit(id=hash)
c.update()
-
- from pygments import highlight
- from pygments.lexers import DiffLexer
- from pygments.formatters import HtmlFormatter
-
- c.pretty_diff = highlight(c.rawdiff, DiffLexer(), HtmlFormatter())
+ try:
+ from pygments import highlight
+ from pygments.lexers import DiffLexer
+ from pygments.formatters import HtmlFormatter
+ c.pretty_diff = highlight(c.rawdiff, DiffLexer(), HtmlFormatter())
+ except: pass
return render_to_response('git_wiki/commit.html',
dict(heads=heads, tags=tags,