##// END OF EJS Templates
templatekw: change joinfmt to a mandatory argument of _hybrid object...
Yuya Nishihara -
r29669:bdc81970 default
parent child Browse files
Show More
@@ -26,14 +26,11 b' from . import ('
26 26 # "{get(extras, key)}"
27 27
28 28 class _hybrid(object):
29 def __init__(self, gen, values, makemap, joinfmt=None):
29 def __init__(self, gen, values, makemap, joinfmt):
30 30 self.gen = gen
31 31 self.values = values
32 32 self._makemap = makemap
33 if joinfmt:
34 33 self.joinfmt = joinfmt
35 else:
36 self.joinfmt = lambda x: x.values()[0]
37 34 def __iter__(self):
38 35 return self.gen
39 36 def itermaps(self):
@@ -53,7 +50,7 b' def showlist(name, values, plural=None, '
53 50 if not element:
54 51 element = name
55 52 f = _showlist(name, values, plural, separator, **args)
56 return _hybrid(f, values, lambda x: {element: x})
53 return _hybrid(f, values, lambda x: {element: x}, lambda d: d[element])
57 54
58 55 def _showlist(name, values, plural=None, separator=' ', **args):
59 56 '''expand set of values.
General Comments 0
You need to be logged in to leave comments. Login now