Mercurial > hg
comparison mercurial/templater.py @ 17637:02d2166ef5f1
templater: pull in functions defined in templatefilters
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 24 Sep 2012 15:28:04 -0500 |
parents | ce18dbcd91c8 |
children | 9a3cb3ce011e |
comparison
equal
deleted
inserted
replaced
17636:ce18dbcd91c8 | 17637:02d2166ef5f1 |
---|---|
190 n = getsymbol(exp[1]) | 190 n = getsymbol(exp[1]) |
191 args = [compileexp(x, context) for x in getlist(exp[2])] | 191 args = [compileexp(x, context) for x in getlist(exp[2])] |
192 if n in funcs: | 192 if n in funcs: |
193 f = funcs[n] | 193 f = funcs[n] |
194 return (f, args) | 194 return (f, args) |
195 if n in templatefilters.funcs: | |
196 f = templatefilters.funcs[n] | |
197 return (f, args) | |
195 if n in context._filters: | 198 if n in context._filters: |
196 if len(args) != 1: | 199 if len(args) != 1: |
197 raise error.ParseError(_("filter %s expects one argument") % n) | 200 raise error.ParseError(_("filter %s expects one argument") % n) |
198 f = context._filters[n] | 201 f = context._filters[n] |
199 return (runfilter, (args[0][0], args[0][1], f)) | 202 return (runfilter, (args[0][0], args[0][1], f)) |