Show More
@@ -31,6 +31,10 b' class baseformatter(object):' | |||||
31 | '''do default text output while assigning data to item''' |
|
31 | '''do default text output while assigning data to item''' | |
32 | for k, v in zip(fields.split(), fielddata): |
|
32 | for k, v in zip(fields.split(), fielddata): | |
33 | self._item[k] = v |
|
33 | self._item[k] = v | |
|
34 | def condwrite(self, cond, fields, deftext, *fielddata, **opts): | |||
|
35 | '''do conditional write (primarily for plain formatter)''' | |||
|
36 | for k, v in zip(fields.split(), fielddata): | |||
|
37 | self._item[k] = v | |||
34 | def plain(self, text, **opts): |
|
38 | def plain(self, text, **opts): | |
35 | '''show raw text for non-templated mode''' |
|
39 | '''show raw text for non-templated mode''' | |
36 | pass |
|
40 | pass | |
@@ -51,6 +55,10 b' class plainformatter(baseformatter):' | |||||
51 | pass |
|
55 | pass | |
52 | def write(self, fields, deftext, *fielddata, **opts): |
|
56 | def write(self, fields, deftext, *fielddata, **opts): | |
53 | self._ui.write(deftext % fielddata, **opts) |
|
57 | self._ui.write(deftext % fielddata, **opts) | |
|
58 | def condwrite(self, cond, fields, deftext, *fielddata, **opts): | |||
|
59 | '''do conditional write''' | |||
|
60 | if cond: | |||
|
61 | self._ui.write(deftext % fielddata, **opts) | |||
54 | def plain(self, text, **opts): |
|
62 | def plain(self, text, **opts): | |
55 | self._ui.write(text, **opts) |
|
63 | self._ui.write(text, **opts) | |
56 | def end(self): |
|
64 | def end(self): |
General Comments 0
You need to be logged in to leave comments.
Login now