Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgwebdir_mod.py @ 22634:e48a5d3996c2
templater: introduce templatepaths for getting paths searched for templates
Avoid function with different return types depending on parameters.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Sun, 28 Sep 2014 16:57:37 +0200 |
parents | af62f0280a76 |
children | ef36536abea3 78e8890cfb4b |
comparison
equal
deleted
inserted
replaced
22633:92b54547ac5d | 22634:e48a5d3996c2 |
---|---|
191 else: | 191 else: |
192 fname = req.form['static'][0] | 192 fname = req.form['static'][0] |
193 static = self.ui.config("web", "static", None, | 193 static = self.ui.config("web", "static", None, |
194 untrusted=False) | 194 untrusted=False) |
195 if not static: | 195 if not static: |
196 tp = self.templatepath or templater.templatepath() | 196 tp = self.templatepath or templater.templatepaths() |
197 if isinstance(tp, str): | 197 if isinstance(tp, str): |
198 tp = [tp] | 198 tp = [tp] |
199 static = [os.path.join(p, 'static') for p in tp] | 199 static = [os.path.join(p, 'static') for p in tp] |
200 staticfile(static, fname, req) | 200 staticfile(static, fname, req) |
201 return [] | 201 return [] |