##// END OF EJS Templates
templater: move function table to the "context" object...
Yuya Nishihara -
r36930:543afbdc default
parent child Browse files
Show More
@@ -493,8 +493,8 b' def buildfilter(exp, context):'
493 493 filt = context._filters[n]
494 494 arg = compileexp(exp[1], context, methods)
495 495 return (runfilter, (arg, filt))
496 if n in funcs:
497 f = funcs[n]
496 if n in context._funcs:
497 f = context._funcs[n]
498 498 args = _buildfuncargs(exp[1], context, methods, n, f._argspec)
499 499 return (f, args)
500 500 raise error.ParseError(_("unknown function '%s'") % n)
@@ -595,8 +595,8 b' def runarithmetic(context, mapping, data'
595 595
596 596 def buildfunc(exp, context):
597 597 n = getsymbol(exp[1])
598 if n in funcs:
599 f = funcs[n]
598 if n in context._funcs:
599 f = context._funcs[n]
600 600 args = _buildfuncargs(exp[2], context, exprmethods, n, f._argspec)
601 601 return (f, args)
602 602 if n in context._filters:
@@ -1376,6 +1376,7 b' class engine(object):'
1376 1376 if filters is None:
1377 1377 filters = {}
1378 1378 self._filters = filters
1379 self._funcs = funcs # make this a parameter if needed
1379 1380 if defaults is None:
1380 1381 defaults = {}
1381 1382 if resources is None:
General Comments 0
You need to be logged in to leave comments. Login now