summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/Bcfg2/Server/Reports/reports/templatetags/syntax_coloring.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Reports/reports/templatetags/syntax_coloring.py b/src/lib/Bcfg2/Server/Reports/reports/templatetags/syntax_coloring.py
index 7dae62cbd..36d4cf693 100644
--- a/src/lib/Bcfg2/Server/Reports/reports/templatetags/syntax_coloring.py
+++ b/src/lib/Bcfg2/Server/Reports/reports/templatetags/syntax_coloring.py
@@ -15,6 +15,7 @@ try:
except:
colorize = False
+
# py3k compatibility
def u_str(string):
if sys.hexversion >= 0x03000000:
@@ -22,10 +23,12 @@ def u_str(string):
else:
return unicode(string)
+
@register.filter
def syntaxhilight(value, arg="diff", autoescape=None):
"""
- Returns a syntax-hilighted version of Code; requires code/language arguments
+ Returns a syntax-hilighted version of Code;
+ requires code/language arguments
"""
if autoescape:
@@ -44,6 +47,6 @@ def syntaxhilight(value, arg="diff", autoescape=None):
except:
return value
else:
- return mark_safe(u_str('<div class="note-box">Tip: Install pygments for highlighting</div><pre>%s</pre>') % value)
+ return mark_safe(u_str('<div class="note-box">Tip: Install pygments '
+ 'for highlighting</div><pre>%s</pre>') % value)
syntaxhilight.needs_autoescape = True
-