comparison mercurial/hgweb/hgwebdir_mod.py @ 8360:acc202b71619

templater: provide the standard template filters by default
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Tue, 12 May 2009 12:04:05 +0200
parents 07ddec2ea203
children 1bd0fdf4c1ec
comparison
equal deleted inserted replaced
8359:07ddec2ea203 8360:acc202b71619
6 # This software may be used and distributed according to the terms of the 6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2, incorporated herein by reference. 7 # GNU General Public License version 2, incorporated herein by reference.
8 8
9 import os 9 import os
10 from mercurial.i18n import _ 10 from mercurial.i18n import _
11 from mercurial import ui, hg, util, templater, templatefilters 11 from mercurial import ui, hg, util, templater
12 from mercurial import error, encoding 12 from mercurial import error, encoding
13 from common import ErrorResponse, get_mtime, staticfile, paritygen,\ 13 from common import ErrorResponse, get_mtime, staticfile, paritygen,\
14 get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR 14 get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
15 from hgweb_mod import hgweb 15 from hgweb_mod import hgweb
16 from request import wsgirequest 16 from request import wsgirequest
302 if not staticurl.endswith('/'): 302 if not staticurl.endswith('/'):
303 staticurl += '/' 303 staticurl += '/'
304 304
305 style = 'style' in req.form and req.form['style'][0] or self.style 305 style = 'style' in req.form and req.form['style'][0] or self.style
306 mapfile = templater.stylemap(style) 306 mapfile = templater.stylemap(style)
307 tmpl = templater.templater(mapfile, templatefilters.filters, 307 tmpl = templater.templater(mapfile,
308 defaults={"header": header, 308 defaults={"header": header,
309 "footer": footer, 309 "footer": footer,
310 "motd": motd, 310 "motd": motd,
311 "url": url, 311 "url": url,
312 "staticurl": staticurl, 312 "staticurl": staticurl,