Mercurial > public > mercurial-scm > hg
comparison mercurial/formatter.py @ 17597:772b3764d3e8
formatter: add base implementation of data method
Previously, nothing was done with the passed in values, which clearly wasn't
the intention.
author | David M. Carr <david@carrclan.us> |
---|---|
date | Sat, 15 Sep 2012 22:50:34 -0400 |
parents | 3c0327ea20c0 |
children | ff5ed1ecd43a |
comparison
equal
deleted
inserted
replaced
17596:2eac9641496d | 17597:772b3764d3e8 |
---|---|
24 if self._item is not None: | 24 if self._item is not None: |
25 self._showitem() | 25 self._showitem() |
26 self._item = {} | 26 self._item = {} |
27 def data(self, **data): | 27 def data(self, **data): |
28 '''insert data into item that's not shown in default output''' | 28 '''insert data into item that's not shown in default output''' |
29 for k, v in data.iteritems(): | |
30 self._item[k] = v | |
29 def write(self, fields, deftext, *fielddata, **opts): | 31 def write(self, fields, deftext, *fielddata, **opts): |
30 '''do default text output while assigning data to item''' | 32 '''do default text output while assigning data to item''' |
31 for k, v in zip(fields.split(), fielddata): | 33 for k, v in zip(fields.split(), fielddata): |
32 self._item[k] = v | 34 self._item[k] = v |
33 def plain(self, text, **opts): | 35 def plain(self, text, **opts): |