##// END OF EJS Templates
templater: process mapping dict by resource callables...
Yuya Nishihara -
r36998:036e4483 default
parent child Browse files
Show More
@@ -508,6 +508,9 b' def templateresources(ui, repo=None):'
508 }
508 }
509
509
510 def getsome(context, mapping, key):
510 def getsome(context, mapping, key):
511 v = mapping.get(key)
512 if v is not None:
513 return v
511 return resmap.get(key)
514 return resmap.get(key)
512
515
513 return {
516 return {
@@ -565,8 +565,6 b' class engine(object):'
565 evaluation"""
565 evaluation"""
566 v = None
566 v = None
567 if key in self._resources:
567 if key in self._resources:
568 v = mapping.get(key)
569 if v is None and key in self._resources:
570 v = self._resources[key](self, mapping, key)
568 v = self._resources[key](self, mapping, key)
571 if v is None:
569 if v is None:
572 raise templateutil.ResourceUnavailable(
570 raise templateutil.ResourceUnavailable(
@@ -671,8 +669,7 b' class templater(object):'
671 - ``defaults``: a dict of symbol values/functions; may be overridden
669 - ``defaults``: a dict of symbol values/functions; may be overridden
672 by a ``mapping`` dict.
670 by a ``mapping`` dict.
673 - ``resources``: a dict of functions returning internal data
671 - ``resources``: a dict of functions returning internal data
674 (e.g. cache), inaccessible from user template; may be overridden by
672 (e.g. cache), inaccessible from user template.
675 a ``mapping`` dict.
676 - ``cache``: a dict of preloaded template fragments.
673 - ``cache``: a dict of preloaded template fragments.
677 - ``aliases``: a list of alias (name, replacement) pairs.
674 - ``aliases``: a list of alias (name, replacement) pairs.
678
675
General Comments 0
You need to be logged in to leave comments. Login now