Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/webcommands.py @ 7107:125c8fedcbe0
Allow hgweb to search for templates in more than one path.
This patch is constructed to make it easy for external extensions to
provide their own templates, by updating templater.path.
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Fri, 17 Oct 2008 11:34:31 -0700 |
parents | 14f3ea2ea54f |
children | 295af5bc1bcc |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py Sun Oct 05 21:35:26 2008 +0200 +++ b/mercurial/hgweb/webcommands.py Fri Oct 17 11:34:31 2008 -0700 @@ -566,9 +566,15 @@ fname = req.form['file'][0] # a repo owner may set web.static in .hg/hgrc to get any file # readable by the user running the CGI script - static = web.config("web", "static", - os.path.join(web.templatepath, "static"), - untrusted=False) + static = web.config("web", "static", None, untrusted=False) + if not static: + tp = web.templatepath + if isinstance(tp, str): + tp = [tp] + for path in tp: + static = os.path.join(path, 'static') + if os.path.isdir(static): + break return [staticfile(static, fname, req)] def graph(web, req, tmpl):