Mercurial > hg
comparison mercurial/hgweb/hgwebdir_mod.py @ 5976:9f1e6ab76069
templates: move filters to their own module
This eliminates just about all Mercurial dependencies in templater.py
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 31 Jan 2008 14:44:19 -0600 |
parents | f25070ecf334 |
children | 948a41e77902 |
comparison
equal
deleted
inserted
replaced
5975:75d9fe70c654 | 5976:9f1e6ab76069 |
---|---|
6 # This software may be used and distributed according to the terms | 6 # This software may be used and distributed according to the terms |
7 # of the GNU General Public License, incorporated herein by reference. | 7 # of the GNU General Public License, incorporated herein by reference. |
8 | 8 |
9 import os | 9 import os |
10 from mercurial.i18n import gettext as _ | 10 from mercurial.i18n import gettext as _ |
11 from mercurial import ui, hg, util, templater | 11 from mercurial import ui, hg, util, templater, templatefilters |
12 from common import ErrorResponse, get_mtime, staticfile, style_map, paritygen, \ | 12 from common import ErrorResponse, get_mtime, staticfile, style_map, paritygen,\ |
13 get_contact | 13 get_contact |
14 from hgweb_mod import hgweb | 14 from hgweb_mod import hgweb |
15 from request import wsgirequest | 15 from request import wsgirequest |
16 | 16 |
17 # This is a stopgap | 17 # This is a stopgap |
264 if 'style' in req.form: | 264 if 'style' in req.form: |
265 style = req.form['style'][0] | 265 style = req.form['style'][0] |
266 if self.stripecount is None: | 266 if self.stripecount is None: |
267 self.stripecount = int(config('web', 'stripes', 1)) | 267 self.stripecount = int(config('web', 'stripes', 1)) |
268 mapfile = style_map(templater.templatepath(), style) | 268 mapfile = style_map(templater.templatepath(), style) |
269 tmpl = templater.templater(mapfile, templater.common_filters, | 269 tmpl = templater.templater(mapfile, templatefilters.filters, |
270 defaults={"header": header, | 270 defaults={"header": header, |
271 "footer": footer, | 271 "footer": footer, |
272 "motd": motd, | 272 "motd": motd, |
273 "url": url, | 273 "url": url, |
274 "staticurl": staticurl}) | 274 "staticurl": staticurl}) |