Mercurial > public > mercurial-scm > hg-stable
diff mercurial/formatter.py @ 36927:32f9b7e3f056
templater: move hybrid class and functions to templateutil module
And make _hybrid and _mappable classes public. _showlist() is still marked
as private since it's weird and third-party codes shouldn't depend on it.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 08 Mar 2018 23:15:09 +0900 |
parents | 6ff6e1d6b5b8 |
children | 255f635c3204 |
line wrap: on
line diff
--- a/mercurial/formatter.py Thu Mar 08 23:10:46 2018 +0900 +++ b/mercurial/formatter.py Thu Mar 08 23:15:09 2018 +0900 @@ -359,14 +359,15 @@ data = util.sortdict(_iteritems(data)) def f(): yield _plainconverter.formatdict(data, key, value, fmt, sep) - return templatekw.hybriddict(data, key=key, value=value, fmt=fmt, gen=f) + return templateutil.hybriddict(data, key=key, value=value, fmt=fmt, + gen=f) @staticmethod def formatlist(data, name, fmt, sep): '''build object that can be evaluated as either plain string or list''' data = list(data) def f(): yield _plainconverter.formatlist(data, name, fmt, sep) - return templatekw.hybridlist(data, name=name, fmt=fmt, gen=f) + return templateutil.hybridlist(data, name=name, fmt=fmt, gen=f) class templateformatter(baseformatter): def __init__(self, ui, out, topic, opts):