From a702489e0aa19ca12592951f62c44dc4cf7ddedc Mon Sep 17 00:00:00 2001 From: Toby Dacre Date: Wed, 5 Sep 2018 21:18:07 +0200 Subject: [PATCH] Revert "formatter: hide block on 'None' string too" This reverts commit fa201dfbbe6e18130c8d8ffbaa3e472dbca0303c. --- py3status/formatter.py | 4 ++-- tests/test_formatter.py | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/py3status/formatter.py b/py3status/formatter.py index 6de68e25fb..778417e859 100644 --- a/py3status/formatter.py +++ b/py3status/formatter.py @@ -315,11 +315,11 @@ def get(self, get_params, block): value = value_ = output.format(**{self.key: value}) if block.commands.not_zero: - valid = value_ not in ['', 'None', None, False, '0', '0.0', 0, 0.0] + valid = value_ not in ['', None, False, '0', '0.0', 0, 0.0] else: # '', None, and False are ignored # numbers like 0 and 0.0 are not. - valid = not (value_ in ['', 'None', None] or value_ is False) + valid = not (value_ in ['', None] or value_ is False) enough = False except: # noqa e722 # Exception raised when we don't have the param diff --git a/tests/test_formatter.py b/tests/test_formatter.py index 3c613aa1be..647bae2378 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -27,7 +27,6 @@ 'no': False, 'empty': '', 'None': None, - 'None_str': 'None', '?bad name': 'evil', u'☂ Very bad name ': u'☂ extremely evil', 'long_str': 'I am a long string though not too long', @@ -331,10 +330,6 @@ def test_27(): run_formatter({'format': '{None}', 'expected': '', }) -def test_27a(): - run_formatter({'format': '[Hi, my name is {None_str}]', 'expected': '', }) - - def test_28(): run_formatter({'format': '[{None}] hello', 'expected': ' hello', })