Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgwebdir_mod.py @ 36926:6ff6e1d6b5b8
templater: move stringify() to templateutil module
As we have a util module, it doesn't make sense to import stringify() from
templatefilters.py.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 08 Mar 2018 23:10:46 +0900 |
parents | f0a851542a05 |
children | c479692690ef |
comparison
equal
deleted
inserted
replaced
36925:8fba319750c2 | 36926:6ff6e1d6b5b8 |
---|---|
32 hg, | 32 hg, |
33 profiling, | 33 profiling, |
34 pycompat, | 34 pycompat, |
35 scmutil, | 35 scmutil, |
36 templater, | 36 templater, |
37 templateutil, | |
37 ui as uimod, | 38 ui as uimod, |
38 util, | 39 util, |
39 ) | 40 ) |
40 | 41 |
41 from . import ( | 42 from . import ( |
368 res.headers['Content-Security-Policy'] = csp | 369 res.headers['Content-Security-Policy'] = csp |
369 | 370 |
370 virtual = req.dispatchpath.strip('/') | 371 virtual = req.dispatchpath.strip('/') |
371 tmpl = self.templater(req, nonce) | 372 tmpl = self.templater(req, nonce) |
372 ctype = tmpl('mimetype', encoding=encoding.encoding) | 373 ctype = tmpl('mimetype', encoding=encoding.encoding) |
373 ctype = templater.stringify(ctype) | 374 ctype = templateutil.stringify(ctype) |
374 | 375 |
375 # Global defaults. These can be overridden by any handler. | 376 # Global defaults. These can be overridden by any handler. |
376 res.status = '200 Script output follows' | 377 res.status = '200 Script output follows' |
377 res.headers['Content-Type'] = ctype | 378 res.headers['Content-Type'] = ctype |
378 | 379 |