comparison hgext/highlight/__init__.py @ 16683:525fdb738975

cleanup: eradicate long lines
author Brodie Rao <brodie@sf.io>
date Sat, 12 May 2012 15:54:54 +0200
parents 25e572394f5c
children 38caf405d010
comparison
equal deleted inserted replaced
16676:654b9e1966f7 16683:525fdb738975
49 49
50 def generate_css(web, req, tmpl): 50 def generate_css(web, req, tmpl):
51 pg_style = web.config('web', 'pygments_style', 'colorful') 51 pg_style = web.config('web', 'pygments_style', 'colorful')
52 fmter = highlight.HtmlFormatter(style = pg_style) 52 fmter = highlight.HtmlFormatter(style = pg_style)
53 req.respond(common.HTTP_OK, 'text/css') 53 req.respond(common.HTTP_OK, 'text/css')
54 return ['/* pygments_style = %s */\n\n' % pg_style, fmter.get_style_defs('')] 54 return ['/* pygments_style = %s */\n\n' % pg_style,
55 fmter.get_style_defs('')]
55 56
56 def extsetup(): 57 def extsetup():
57 # monkeypatch in the new version 58 # monkeypatch in the new version
58 extensions.wrapfunction(webcommands, '_filerevision', filerevision_highlight) 59 extensions.wrapfunction(webcommands, '_filerevision',
60 filerevision_highlight)
59 extensions.wrapfunction(webcommands, 'annotate', annotate_highlight) 61 extensions.wrapfunction(webcommands, 'annotate', annotate_highlight)
60 webcommands.highlightcss = generate_css 62 webcommands.highlightcss = generate_css
61 webcommands.__all__.append('highlightcss') 63 webcommands.__all__.append('highlightcss')