Show More
@@ -34,7 +34,7 b' class _hybrid(object):' | |||||
34 | self.joinfmt = lambda x: x.values()[0] |
|
34 | self.joinfmt = lambda x: x.values()[0] | |
35 | def __iter__(self): |
|
35 | def __iter__(self): | |
36 | return self.gen |
|
36 | return self.gen | |
37 |
def |
|
37 | def itermaps(self): | |
38 | makemap = self._makemap |
|
38 | makemap = self._makemap | |
39 | for x in self.values: |
|
39 | for x in self.values: | |
40 | yield makemap(x) |
|
40 | yield makemap(x) |
@@ -281,8 +281,8 b' def buildmap(exp, context):' | |||||
281 | def runmap(context, mapping, data): |
|
281 | def runmap(context, mapping, data): | |
282 | func, data, ctmpl = data |
|
282 | func, data, ctmpl = data | |
283 | d = func(context, mapping, data) |
|
283 | d = func(context, mapping, data) | |
284 | if callable(d): |
|
284 | if util.safehasattr(d, 'itermaps'): | |
285 | d = d() |
|
285 | d = d.itermaps() | |
286 |
|
286 | |||
287 | lm = mapping.copy() |
|
287 | lm = mapping.copy() | |
288 |
|
288 | |||
@@ -483,9 +483,9 b' def join(context, mapping, args):' | |||||
483 | raise error.ParseError(_("join expects one or two arguments")) |
|
483 | raise error.ParseError(_("join expects one or two arguments")) | |
484 |
|
484 | |||
485 | joinset = args[0][0](context, mapping, args[0][1]) |
|
485 | joinset = args[0][0](context, mapping, args[0][1]) | |
486 | if callable(joinset): |
|
486 | if util.safehasattr(joinset, 'itermaps'): | |
487 | jf = joinset.joinfmt |
|
487 | jf = joinset.joinfmt | |
488 | joinset = [jf(x) for x in joinset()] |
|
488 | joinset = [jf(x) for x in joinset.itermaps()] | |
489 |
|
489 | |||
490 | joiner = " " |
|
490 | joiner = " " | |
491 | if len(args) > 1: |
|
491 | if len(args) > 1: |
General Comments 0
You need to be logged in to leave comments.
Login now