##// END OF EJS Templates
templater: pass context to itermaps() for future extension...
Yuya Nishihara -
r37340:c2f74b8f default
parent child Browse files
Show More
@@ -38,7 +38,7 b' class wrapped(object):'
38 38 __metaclass__ = abc.ABCMeta
39 39
40 40 @abc.abstractmethod
41 def itermaps(self):
41 def itermaps(self, context):
42 42 """Yield each template mapping"""
43 43
44 44 @abc.abstractmethod
@@ -88,7 +88,7 b' class hybrid(wrapped):'
88 88 if i > 0:
89 89 yield ' '
90 90 yield self.joinfmt(x)
91 def itermaps(self):
91 def itermaps(self, context):
92 92 makemap = self._makemap
93 93 for x in self._values:
94 94 yield makemap(x)
@@ -139,7 +139,7 b' class mappable(wrapped):'
139 139 def tomap(self):
140 140 return self._makemap(self._key)
141 141
142 def itermaps(self):
142 def itermaps(self, context):
143 143 yield self.tomap()
144 144
145 145 def show(self, context, mapping):
@@ -498,7 +498,7 b' def runmap(context, mapping, data):'
498 498 darg, targ = data
499 499 d = evalrawexp(context, mapping, darg)
500 500 if isinstance(d, wrapped):
501 diter = d.itermaps()
501 diter = d.itermaps(context)
502 502 else:
503 503 try:
504 504 diter = iter(d)
General Comments 0
You need to be logged in to leave comments. Login now