Mercurial > public > mercurial-scm > hg
comparison mercurial/formatter.py @ 22447:2642ce9be6ef
formatter: correct bool testing which should be __nonzero__ in Python 2
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 17 Sep 2014 00:31:03 +0900 |
parents | 968247e8f4ac |
children | 9da0ef363861 |
comparison
equal
deleted
inserted
replaced
22446:054ec0212718 | 22447:2642ce9be6ef |
---|---|
14 self._ui = ui | 14 self._ui = ui |
15 self._topic = topic | 15 self._topic = topic |
16 self._style = opts.get("style") | 16 self._style = opts.get("style") |
17 self._template = opts.get("template") | 17 self._template = opts.get("template") |
18 self._item = None | 18 self._item = None |
19 def __bool__(self): | 19 def __nonzero__(self): |
20 '''return False if we're not doing real templating so we can | 20 '''return False if we're not doing real templating so we can |
21 skip extra work''' | 21 skip extra work''' |
22 return True | 22 return True |
23 def _showitem(self): | 23 def _showitem(self): |
24 '''show a formatted item once all data is collected''' | 24 '''show a formatted item once all data is collected''' |
49 | 49 |
50 class plainformatter(baseformatter): | 50 class plainformatter(baseformatter): |
51 '''the default text output scheme''' | 51 '''the default text output scheme''' |
52 def __init__(self, ui, topic, opts): | 52 def __init__(self, ui, topic, opts): |
53 baseformatter.__init__(self, ui, topic, opts) | 53 baseformatter.__init__(self, ui, topic, opts) |
54 def __bool__(self): | 54 def __nonzero__(self): |
55 return False | 55 return False |
56 def startitem(self): | 56 def startitem(self): |
57 pass | 57 pass |
58 def data(self, **data): | 58 def data(self, **data): |
59 pass | 59 pass |