mercurial/formatter.py
changeset 31925 5b2241e84982
parent 31924 21f129354dd0
child 32159 0fd15522a848
equal deleted inserted replaced
31924:21f129354dd0 31925:5b2241e84982
   319     def formatdict(data, key, value, fmt, sep):
   319     def formatdict(data, key, value, fmt, sep):
   320         '''build object that can be evaluated as either plain string or dict'''
   320         '''build object that can be evaluated as either plain string or dict'''
   321         data = util.sortdict(_iteritems(data))
   321         data = util.sortdict(_iteritems(data))
   322         def f():
   322         def f():
   323             yield _plainconverter.formatdict(data, key, value, fmt, sep)
   323             yield _plainconverter.formatdict(data, key, value, fmt, sep)
   324         return templatekw._hybrid(f(), data, lambda k: {key: k, value: data[k]},
   324         return templatekw.hybriddict(data, key=key, value=value, fmt=fmt,
   325                                   lambda d: fmt % (d[key], d[value]))
   325                                      gen=f())
   326     @staticmethod
   326     @staticmethod
   327     def formatlist(data, name, fmt, sep):
   327     def formatlist(data, name, fmt, sep):
   328         '''build object that can be evaluated as either plain string or list'''
   328         '''build object that can be evaluated as either plain string or list'''
   329         data = list(data)
   329         data = list(data)
   330         def f():
   330         def f():