##// 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 __metaclass__ = abc.ABCMeta
38 __metaclass__ = abc.ABCMeta
39
39
40 @abc.abstractmethod
40 @abc.abstractmethod
41 def itermaps(self):
41 def itermaps(self, context):
42 """Yield each template mapping"""
42 """Yield each template mapping"""
43
43
44 @abc.abstractmethod
44 @abc.abstractmethod
@@ -88,7 +88,7 b' class hybrid(wrapped):'
88 if i > 0:
88 if i > 0:
89 yield ' '
89 yield ' '
90 yield self.joinfmt(x)
90 yield self.joinfmt(x)
91 def itermaps(self):
91 def itermaps(self, context):
92 makemap = self._makemap
92 makemap = self._makemap
93 for x in self._values:
93 for x in self._values:
94 yield makemap(x)
94 yield makemap(x)
@@ -139,7 +139,7 b' class mappable(wrapped):'
139 def tomap(self):
139 def tomap(self):
140 return self._makemap(self._key)
140 return self._makemap(self._key)
141
141
142 def itermaps(self):
142 def itermaps(self, context):
143 yield self.tomap()
143 yield self.tomap()
144
144
145 def show(self, context, mapping):
145 def show(self, context, mapping):
@@ -498,7 +498,7 b' def runmap(context, mapping, data):'
498 darg, targ = data
498 darg, targ = data
499 d = evalrawexp(context, mapping, darg)
499 d = evalrawexp(context, mapping, darg)
500 if isinstance(d, wrapped):
500 if isinstance(d, wrapped):
501 diter = d.itermaps()
501 diter = d.itermaps(context)
502 else:
502 else:
503 try:
503 try:
504 diter = iter(d)
504 diter = iter(d)
General Comments 0
You need to be logged in to leave comments. Login now