##// END OF EJS Templates
templater: define interface for objects which act as iterator of mappings
Yuya Nishihara -
r37339:8c31b434 default
parent child Browse files
Show More
@@ -38,6 +38,10 b' class wrapped(object):'
38 38 __metaclass__ = abc.ABCMeta
39 39
40 40 @abc.abstractmethod
41 def itermaps(self):
42 """Yield each template mapping"""
43
44 @abc.abstractmethod
41 45 def show(self, context, mapping):
42 46 """Return a bytes or (possibly nested) generator of bytes representing
43 47 the underlying object
@@ -493,7 +497,7 b' def _formatfiltererror(arg, filt):'
493 497 def runmap(context, mapping, data):
494 498 darg, targ = data
495 499 d = evalrawexp(context, mapping, darg)
496 if util.safehasattr(d, 'itermaps'):
500 if isinstance(d, wrapped):
497 501 diter = d.itermaps()
498 502 else:
499 503 try:
General Comments 0
You need to be logged in to leave comments. Login now