Mercurial > hg
changeset 25595:a7dd6692e5cb
templater: move runtemplate function out of buildmap/runmap pair
The next patch will introduce buildtemplate function that should be defined
near runtemplate. But I don't want to insert it between buildmap and runmap.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 13 Jun 2015 00:15:22 +0900 |
parents | 186321309d05 |
children | c1975809a6b5 |
files | mercurial/templater.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templater.py Mon Jun 15 16:08:22 2015 -0700 +++ b/mercurial/templater.py Sat Jun 13 00:15:22 2015 +0900 @@ -174,6 +174,10 @@ v = list(v) return v +def runtemplate(context, mapping, template): + for func, data in template: + yield func(context, mapping, data) + def buildfilter(exp, context): func, data = compileexp(exp[1], context, methods) filt = getfilter(exp[2], context) @@ -201,10 +205,6 @@ ctmpl = gettemplate(exp[2], context) return (runmap, (func, data, ctmpl)) -def runtemplate(context, mapping, template): - for func, data in template: - yield func(context, mapping, data) - def runmap(context, mapping, data): func, data, ctmpl = data d = func(context, mapping, data)